fix imports
This commit is contained in:
parent
f2447a6a70
commit
921d37dbd5
1 changed files with 5 additions and 6 deletions
|
@ -292,9 +292,9 @@
|
||||||
//! to it *cannot* panic.
|
//! to it *cannot* panic.
|
||||||
//!
|
//!
|
||||||
//! ```
|
//! ```
|
||||||
//! use core::marker::PhantomPinned;
|
//! use std::marker::PhantomPinned;
|
||||||
//! use core::pin::Pin;
|
//! use std::pin::Pin;
|
||||||
//! use core::pin::pin;
|
//! use std::pin::pin;
|
||||||
//!
|
//!
|
||||||
//! #[derive(Default)]
|
//! #[derive(Default)]
|
||||||
//! struct AddrTracker {
|
//! struct AddrTracker {
|
||||||
|
@ -327,9 +327,8 @@
|
||||||
//! let mut ptr_to_pinned_tracker: Pin<&mut AddrTracker> = pin!(tracker);
|
//! let mut ptr_to_pinned_tracker: Pin<&mut AddrTracker> = pin!(tracker);
|
||||||
//! ptr_to_pinned_tracker.as_mut().check_for_move();
|
//! ptr_to_pinned_tracker.as_mut().check_for_move();
|
||||||
//!
|
//!
|
||||||
//! // Trying to access `tracker` or pass `ptr_to_pinned_tracker` to anything
|
//! // Trying to access `tracker` or pass `ptr_to_pinned_tracker` to anything that requires
|
||||||
//! // that requires mutable access to a non-pinned version of it will no longer
|
//! // mutable access to a non-pinned version of it will no longer compile
|
||||||
//! // compile
|
|
||||||
//!
|
//!
|
||||||
//! // 3. We can now assume that the tracker value will never be moved, thus
|
//! // 3. We can now assume that the tracker value will never be moved, thus
|
||||||
//! // this will never panic!
|
//! // this will never panic!
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue