Skip to content

Commit

Permalink
Fix doctest
Browse files Browse the repository at this point in the history
  • Loading branch information
udoprog committed Jan 28, 2024
1 parent eebc720 commit ef55c61
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions library/alloc/src/rc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1419,11 +1419,11 @@ impl<T: ?Sized, A: Allocator> Rc<T, A> {
/// use std::rc::Rc;
/// use std::alloc::System;
///
/// let x: Rc<[u32]> = Rc::new_in([1, 2, 3], System);
/// let x: Rc<[u32], _> = Rc::new_in([1, 2, 3], System);
/// let x_ptr: *const [u32] = Rc::into_raw(x);
///
/// unsafe {
/// let x: Rc<[u32; 3]> = Rc::from_raw_in(x_ptr.cast::<[u32; 3]>(), System);
/// let x: Rc<[u32; 3], _> = Rc::from_raw_in(x_ptr.cast::<[u32; 3]>(), System);
/// assert_eq!(&*x, &[1, 2, 3]);
/// }
/// ```
Expand Down
4 changes: 2 additions & 2 deletions library/alloc/src/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1570,11 +1570,11 @@ impl<T: ?Sized, A: Allocator> Arc<T, A> {
/// use std::sync::Arc;
/// use std::alloc::System;
///
/// let x: Arc<[u32]> = Arc::new_in([1, 2, 3], System);
/// let x: Arc<[u32], _> = Arc::new_in([1, 2, 3], System);
/// let x_ptr: *const [u32] = Arc::into_raw(x);
///
/// unsafe {
/// let x: Arc<[u32; 3]> = Arc::from_raw_in(x_ptr.cast::<[u32; 3]>(), System);
/// let x: Arc<[u32; 3], _> = Arc::from_raw_in(x_ptr.cast::<[u32; 3]>(), System);
/// assert_eq!(&*x, &[1, 2, 3]);
/// }
/// ```
Expand Down

0 comments on commit ef55c61

Please sign in to comment.