From d63384d689ef9dab759eee57e3c2b0f82dfef4e3 Mon Sep 17 00:00:00 2001 From: John-John Tedro Date: Sun, 28 Jan 2024 16:38:38 +0100 Subject: Fix doctest --- library/alloc/src/rc.rs | 4 ++-- library/alloc/src/sync.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'library/alloc') 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 Rc { /// 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 Arc { /// 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] -- cgit 1.4.1-3-g733a5