Skip to content

Commit d63384d

Browse files
committed
Fix doctest
1 parent 23c83fa commit d63384d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Diff for: library/alloc/src/rc.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1235,8 +1235,8 @@ impl<T: ?Sized> Rc<T> {
12351235
/// let x_ptr: *const [u32] = Rc::into_raw(x);
12361236
///
12371237
/// unsafe {
1238-
/// let x: Rc<[u32; 3]> = Rc::from_raw(x_ptr.cast::<[u32; 3]>())
1239-
/// assert_eq!(x.as_ref(), &[1, 2, 3]);
1238+
/// let x: Rc<[u32; 3]> = Rc::from_raw(x_ptr.cast::<[u32; 3]>());
1239+
/// assert_eq!(&*x, &[1, 2, 3]);
12401240
/// }
12411241
/// ```
12421242
#[inline]

Diff for: library/alloc/src/sync.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1381,8 +1381,8 @@ impl<T: ?Sized> Arc<T> {
13811381
/// let x_ptr: *const [u32] = Arc::into_raw(x);
13821382
///
13831383
/// unsafe {
1384-
/// let x: Arc<[u32; 3]> = Arc::from_raw(x_ptr.cast::<[u32; 3]>())
1385-
/// assert_eq!(x.as_ref(), &[1, 2, 3]);
1384+
/// let x: Arc<[u32; 3]> = Arc::from_raw(x_ptr.cast::<[u32; 3]>());
1385+
/// assert_eq!(&*x, &[1, 2, 3]);
13861386
/// }
13871387
/// ```
13881388
#[inline]

0 commit comments

Comments
 (0)