diff options
| -rw-r--r-- | library/alloc/src/rc.rs | 4 | ||||
| -rw-r--r-- | library/alloc/src/sync.rs | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/library/alloc/src/rc.rs b/library/alloc/src/rc.rs index 1d16095db1e..8331a2d63a0 100644 --- a/library/alloc/src/rc.rs +++ b/library/alloc/src/rc.rs @@ -1235,8 +1235,8 @@ impl<T: ?Sized> Rc<T> { /// let x_ptr: *const [u32] = Rc::into_raw(x); /// /// unsafe { - /// let x: Rc<[u32; 3]> = Rc::from_raw(x_ptr.cast::<[u32; 3]>()) - /// assert_eq!(x.as_ref(), &[1, 2, 3]); + /// let x: Rc<[u32; 3]> = Rc::from_raw(x_ptr.cast::<[u32; 3]>()); + /// assert_eq!(&*x, &[1, 2, 3]); /// } /// ``` #[inline] diff --git a/library/alloc/src/sync.rs b/library/alloc/src/sync.rs index 0487dc5a858..bfbdfce5718 100644 --- a/library/alloc/src/sync.rs +++ b/library/alloc/src/sync.rs @@ -1381,8 +1381,8 @@ impl<T: ?Sized> Arc<T> { /// let x_ptr: *const [u32] = Arc::into_raw(x); /// /// unsafe { - /// let x: Arc<[u32; 3]> = Arc::from_raw(x_ptr.cast::<[u32; 3]>()) - /// assert_eq!(x.as_ref(), &[1, 2, 3]); + /// let x: Arc<[u32; 3]> = Arc::from_raw(x_ptr.cast::<[u32; 3]>()); + /// assert_eq!(&*x, &[1, 2, 3]); /// } /// ``` #[inline] |
