about summary refs log tree commit diff
path: root/library/alloc/src
diff options
context:
space:
mode:
authorJohn-John Tedro <udoprog@tedro.se>2024-01-28 16:38:38 +0100
committerJohn-John Tedro <udoprog@tedro.se>2024-01-28 16:38:38 +0100
commitd63384d689ef9dab759eee57e3c2b0f82dfef4e3 (patch)
tree81f6b9b5d1f59ebe33505c91e09c50923a3eddff /library/alloc/src
parent23c83fab2b16d79b248b1b5f2faf7b538afec9f6 (diff)
downloadrust-d63384d689ef9dab759eee57e3c2b0f82dfef4e3.tar.gz
rust-d63384d689ef9dab759eee57e3c2b0f82dfef4e3.zip
Fix doctest
Diffstat (limited to 'library/alloc/src')
-rw-r--r--library/alloc/src/rc.rs4
-rw-r--r--library/alloc/src/sync.rs4
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]