File tree 1 file changed +5
-6
lines changed
1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change 292
292
//! to it *cannot* panic.
293
293
//!
294
294
//! ```
295
- //! use core ::marker::PhantomPinned;
296
- //! use core ::pin::Pin;
297
- //! use core ::pin::pin;
295
+ //! use std ::marker::PhantomPinned;
296
+ //! use std ::pin::Pin;
297
+ //! use std ::pin::pin;
298
298
//!
299
299
//! #[derive(Default)]
300
300
//! struct AddrTracker {
327
327
//! let mut ptr_to_pinned_tracker: Pin<&mut AddrTracker> = pin!(tracker);
328
328
//! ptr_to_pinned_tracker.as_mut().check_for_move();
329
329
//!
330
- //! // Trying to access `tracker` or pass `ptr_to_pinned_tracker` to anything
331
- //! // that requires mutable access to a non-pinned version of it will no longer
332
- //! // compile
330
+ //! // Trying to access `tracker` or pass `ptr_to_pinned_tracker` to anything that requires
331
+ //! // mutable access to a non-pinned version of it will no longer compile
333
332
//!
334
333
//! // 3. We can now assume that the tracker value will never be moved, thus
335
334
//! // this will never panic!
You can’t perform that action at this time.
0 commit comments