Skip to content

Commit ef55c61

Browse files
committed
Fix doctest
1 parent eebc720 commit ef55c61

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

library/alloc/src/rc.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1419,11 +1419,11 @@ impl<T: ?Sized, A: Allocator> Rc<T, A> {
14191419
/// use std::rc::Rc;
14201420
/// use std::alloc::System;
14211421
///
1422-
/// let x: Rc<[u32]> = Rc::new_in([1, 2, 3], System);
1422+
/// let x: Rc<[u32], _> = Rc::new_in([1, 2, 3], System);
14231423
/// let x_ptr: *const [u32] = Rc::into_raw(x);
14241424
///
14251425
/// unsafe {
1426-
/// let x: Rc<[u32; 3]> = Rc::from_raw_in(x_ptr.cast::<[u32; 3]>(), System);
1426+
/// let x: Rc<[u32; 3], _> = Rc::from_raw_in(x_ptr.cast::<[u32; 3]>(), System);
14271427
/// assert_eq!(&*x, &[1, 2, 3]);
14281428
/// }
14291429
/// ```

library/alloc/src/sync.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1570,11 +1570,11 @@ impl<T: ?Sized, A: Allocator> Arc<T, A> {
15701570
/// use std::sync::Arc;
15711571
/// use std::alloc::System;
15721572
///
1573-
/// let x: Arc<[u32]> = Arc::new_in([1, 2, 3], System);
1573+
/// let x: Arc<[u32], _> = Arc::new_in([1, 2, 3], System);
15741574
/// let x_ptr: *const [u32] = Arc::into_raw(x);
15751575
///
15761576
/// unsafe {
1577-
/// let x: Arc<[u32; 3]> = Arc::from_raw_in(x_ptr.cast::<[u32; 3]>(), System);
1577+
/// let x: Arc<[u32; 3], _> = Arc::from_raw_in(x_ptr.cast::<[u32; 3]>(), System);
15781578
/// assert_eq!(&*x, &[1, 2, 3]);
15791579
/// }
15801580
/// ```

0 commit comments

Comments
 (0)