Skip to content

Commit bdbbf04

Browse files
committed
Fix doctest
1 parent eebc720 commit bdbbf04

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -1387,6 +1387,7 @@ impl<T: ?Sized, A: Allocator> Rc<T, A> {
13871387
/// even if the returned `Rc<T>` is never accessed.
13881388
///
13891389
/// [into_raw]: Rc::into_raw
1390+
/// [transmute]: core::mem::transmute
13901391
/// [unsized coercion]: https://doc.rust-lang.org/reference/type-coercions.html#unsized-coercions
13911392
///
13921393
/// # Examples
@@ -1419,11 +1420,11 @@ impl<T: ?Sized, A: Allocator> Rc<T, A> {
14191420
/// use std::rc::Rc;
14201421
/// use std::alloc::System;
14211422
///
1422-
/// let x: Rc<[u32]> = Rc::new_in([1, 2, 3], System);
1423+
/// let x: Rc<[u32], _> = Rc::new_in([1, 2, 3], System);
14231424
/// let x_ptr: *const [u32] = Rc::into_raw(x);
14241425
///
14251426
/// unsafe {
1426-
/// let x: Rc<[u32; 3]> = Rc::from_raw_in(x_ptr.cast::<[u32; 3]>(), System);
1427+
/// let x: Rc<[u32; 3], _> = Rc::from_raw_in(x_ptr.cast::<[u32; 3]>(), System);
14271428
/// assert_eq!(&*x, &[1, 2, 3]);
14281429
/// }
14291430
/// ```

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -1538,6 +1538,7 @@ impl<T: ?Sized, A: Allocator> Arc<T, A> {
15381538
/// even if the returned `Arc<T>` is never accessed.
15391539
///
15401540
/// [into_raw]: Arc::into_raw
1541+
/// [transmute]: core::mem::transmute
15411542
/// [unsized coercion]: https://doc.rust-lang.org/reference/type-coercions.html#unsized-coercions
15421543
///
15431544
/// # Examples
@@ -1570,11 +1571,11 @@ impl<T: ?Sized, A: Allocator> Arc<T, A> {
15701571
/// use std::sync::Arc;
15711572
/// use std::alloc::System;
15721573
///
1573-
/// let x: Arc<[u32]> = Arc::new_in([1, 2, 3], System);
1574+
/// let x: Arc<[u32], _> = Arc::new_in([1, 2, 3], System);
15741575
/// let x_ptr: *const [u32] = Arc::into_raw(x);
15751576
///
15761577
/// unsafe {
1577-
/// let x: Arc<[u32; 3]> = Arc::from_raw_in(x_ptr.cast::<[u32; 3]>(), System);
1578+
/// let x: Arc<[u32; 3], _> = Arc::from_raw_in(x_ptr.cast::<[u32; 3]>(), System);
15781579
/// assert_eq!(&*x, &[1, 2, 3]);
15791580
/// }
15801581
/// ```

0 commit comments

Comments
 (0)