File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 139139//! otherwise invalidating the memory used to store the data is restricted, too.
140140//! Concretely, for pinned data you have to maintain the invariant
141141//! that *its memory will not get invalidated or repurposed from the moment it gets pinned until
142- //! when [`drop`] is called*. Memory can be invalidated by deallocation, but also by
142+ //! when [`drop`] is called*. Only once [`drop`] returns or panics, the memory may be reused.
143+ //!
144+ //! Memory can be "invalidated" by deallocation, but also by
143145//! replacing a [`Some(v)`] by [`None`], or calling [`Vec::set_len`] to "kill" some elements
144146//! off of a vector. It can be repurposed by using [`ptr::write`] to overwrite it without
145- //! calling the destructor first.
147+ //! calling the destructor first. None of this is allowed for pinned data without calling [`drop`].
146148//!
147149//! This is exactly the kind of guarantee that the intrusive linked list from the previous
148150//! section needs to function correctly.
You can’t perform that action at this time.
0 commit comments