Pin stabilization: fix doctests
This commit is contained in:
parent
610bcaf6f3
commit
3005bf360d
2 changed files with 1 additions and 4 deletions
|
@ -621,7 +621,6 @@ unsafe impl<T: ?Sized> Freeze for &mut T {}
|
||||||
/// So this, for example, can only be done on types implementing `Unpin`:
|
/// So this, for example, can only be done on types implementing `Unpin`:
|
||||||
///
|
///
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// #![feature(pin)]
|
|
||||||
/// use std::mem::replace;
|
/// use std::mem::replace;
|
||||||
/// use std::pin::Pin;
|
/// use std::pin::Pin;
|
||||||
///
|
///
|
||||||
|
|
|
@ -43,8 +43,6 @@
|
||||||
//! # Examples
|
//! # Examples
|
||||||
//!
|
//!
|
||||||
//! ```rust
|
//! ```rust
|
||||||
//! #![feature(pin)]
|
|
||||||
//!
|
|
||||||
//! use std::pin::Pin;
|
//! use std::pin::Pin;
|
||||||
//! use std::marker::PhantomPinned;
|
//! use std::marker::PhantomPinned;
|
||||||
//! use std::ptr::NonNull;
|
//! use std::ptr::NonNull;
|
||||||
|
@ -78,7 +76,7 @@
|
||||||
//! // we know this is safe because modifying a field doesn't move the whole struct
|
//! // we know this is safe because modifying a field doesn't move the whole struct
|
||||||
//! unsafe {
|
//! unsafe {
|
||||||
//! let mut_ref: Pin<&mut Self> = Pin::as_mut(&mut boxed);
|
//! let mut_ref: Pin<&mut Self> = Pin::as_mut(&mut boxed);
|
||||||
//! Pin::get_mut_unchecked(mut_ref).slice = slice;
|
//! Pin::get_unchecked_mut(mut_ref).slice = slice;
|
||||||
//! }
|
//! }
|
||||||
//! boxed
|
//! boxed
|
||||||
//! }
|
//! }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue