diff --git a/library/alloc/src/rc.rs b/library/alloc/src/rc.rs index ebd816fba813b..10daf45f0d1f3 100644 --- a/library/alloc/src/rc.rs +++ b/library/alloc/src/rc.rs @@ -1419,11 +1419,11 @@ impl Rc { /// use std::rc::Rc; /// use std::alloc::System; /// - /// let x: Rc<[u32]> = Rc::new_in([1, 2, 3], System); + /// let x: Rc<[u32], _> = Rc::new_in([1, 2, 3], System); /// let x_ptr: *const [u32] = Rc::into_raw(x); /// /// unsafe { - /// let x: Rc<[u32; 3]> = Rc::from_raw_in(x_ptr.cast::<[u32; 3]>(), System); + /// let x: Rc<[u32; 3], _> = Rc::from_raw_in(x_ptr.cast::<[u32; 3]>(), System); /// assert_eq!(&*x, &[1, 2, 3]); /// } /// ``` diff --git a/library/alloc/src/sync.rs b/library/alloc/src/sync.rs index 96f8f57f9e09a..923e002d6266b 100644 --- a/library/alloc/src/sync.rs +++ b/library/alloc/src/sync.rs @@ -1570,11 +1570,11 @@ impl Arc { /// use std::sync::Arc; /// use std::alloc::System; /// - /// let x: Arc<[u32]> = Arc::new_in([1, 2, 3], System); + /// let x: Arc<[u32], _> = Arc::new_in([1, 2, 3], System); /// let x_ptr: *const [u32] = Arc::into_raw(x); /// /// unsafe { - /// let x: Arc<[u32; 3]> = Arc::from_raw_in(x_ptr.cast::<[u32; 3]>(), System); + /// let x: Arc<[u32; 3], _> = Arc::from_raw_in(x_ptr.cast::<[u32; 3]>(), System); /// assert_eq!(&*x, &[1, 2, 3]); /// } /// ```