Skip to content

Commit 78d45ff

Browse files
committed
Fix doctests.
1 parent 0cfa9b9 commit 78d45ff

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

library/alloc/src/rc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1320,7 +1320,7 @@ impl<T: ?Sized, A: Allocator> Rc<T, A> {
13201320
///
13211321
/// let x = Rc::new_in("hello".to_owned(), System);
13221322
/// let (ptr, alloc) = Rc::into_raw_with_allocator(x);
1323-
/// assert_eq!(unsafe { &*x }, "hello");
1323+
/// assert_eq!(unsafe { &*ptr }, "hello");
13241324
/// let x = unsafe { Rc::from_raw_in(ptr, alloc) };
13251325
/// assert_eq!(&*x, "hello");
13261326
/// ```

library/alloc/src/sync.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1471,6 +1471,7 @@ impl<T: ?Sized, A: Allocator> Arc<T, A> {
14711471
///
14721472
/// let x = Arc::new_in("hello".to_owned(), System);
14731473
/// let (ptr, alloc) = Arc::into_raw_with_allocator(x);
1474+
/// assert_eq!(unsafe { &*ptr }, "hello");
14741475
/// let x = unsafe { Arc::from_raw_in(ptr, alloc) };
14751476
/// assert_eq!(&*x, "hello");
14761477
/// ```

0 commit comments

Comments
 (0)