File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 139
139
//! otherwise invalidating the memory used to store the data is restricted, too.
140
140
//! Concretely, for pinned data you have to maintain the invariant
141
141
//! 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
143
145
//! replacing a [`Some(v)`] by [`None`], or calling [`Vec::set_len`] to "kill" some elements
144
146
//! 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`].
146
148
//!
147
149
//! This is exactly the kind of guarantee that the intrusive linked list from the previous
148
150
//! section needs to function correctly.
You can’t perform that action at this time.
0 commit comments