Fix doctest
This commit is contained in:
parent
23c83fab2b
commit
d63384d689
@ -1235,8 +1235,8 @@ impl<T: ?Sized> Rc<T> {
|
|||||||
/// let x_ptr: *const [u32] = Rc::into_raw(x);
|
/// let x_ptr: *const [u32] = Rc::into_raw(x);
|
||||||
///
|
///
|
||||||
/// unsafe {
|
/// unsafe {
|
||||||
/// let x: Rc<[u32; 3]> = Rc::from_raw(x_ptr.cast::<[u32; 3]>())
|
/// let x: Rc<[u32; 3]> = Rc::from_raw(x_ptr.cast::<[u32; 3]>());
|
||||||
/// assert_eq!(x.as_ref(), &[1, 2, 3]);
|
/// assert_eq!(&*x, &[1, 2, 3]);
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
#[inline]
|
#[inline]
|
||||||
|
@ -1381,8 +1381,8 @@ impl<T: ?Sized> Arc<T> {
|
|||||||
/// let x_ptr: *const [u32] = Arc::into_raw(x);
|
/// let x_ptr: *const [u32] = Arc::into_raw(x);
|
||||||
///
|
///
|
||||||
/// unsafe {
|
/// unsafe {
|
||||||
/// let x: Arc<[u32; 3]> = Arc::from_raw(x_ptr.cast::<[u32; 3]>())
|
/// let x: Arc<[u32; 3]> = Arc::from_raw(x_ptr.cast::<[u32; 3]>());
|
||||||
/// assert_eq!(x.as_ref(), &[1, 2, 3]);
|
/// assert_eq!(&*x, &[1, 2, 3]);
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
#[inline]
|
#[inline]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user