mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-27 23:22:58 +00:00
Pin stabilization: fix doctests
This commit is contained in:
parent
610bcaf6f3
commit
3005bf360d
@ -621,7 +621,6 @@ unsafe impl<T: ?Sized> Freeze for &mut T {}
|
||||
/// So this, for example, can only be done on types implementing `Unpin`:
|
||||
///
|
||||
/// ```rust
|
||||
/// #![feature(pin)]
|
||||
/// use std::mem::replace;
|
||||
/// use std::pin::Pin;
|
||||
///
|
||||
|
@ -43,8 +43,6 @@
|
||||
//! # Examples
|
||||
//!
|
||||
//! ```rust
|
||||
//! #![feature(pin)]
|
||||
//!
|
||||
//! use std::pin::Pin;
|
||||
//! use std::marker::PhantomPinned;
|
||||
//! use std::ptr::NonNull;
|
||||
@ -78,7 +76,7 @@
|
||||
//! // we know this is safe because modifying a field doesn't move the whole struct
|
||||
//! unsafe {
|
||||
//! 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
|
||||
//! }
|
||||
|
Loading…
Reference in New Issue
Block a user