|
146 | 146 | //! There are two possible ways to ensure the invariants required for 2. and 3. above (which |
147 | 147 | //! apply to any address-sensitive type, not just self-referrential types) do not get broken. |
148 | 148 | //! |
149 | | -//! 1. Have the value detect when it is moved and update all the pointers that point to itself |
| 149 | +//! 1. Have the value detect when it is moved and update all the pointers that point to itself. |
150 | 150 | //! 2. Guarantee that the address of the value does not change (and that memory is not re-used |
151 | 151 | //! for anything else) during the time that the pointers to it are expected to be valid to |
152 | | -//! dereference |
| 152 | +//! dereference. |
153 | 153 | //! |
154 | 154 | //! Since, as we discussed, Rust can move values without notifying them that they have moved, the |
155 | 155 | //! first option is ruled out. |
|
203 | 203 | //! will not be *moved* or [otherwise invalidated][subtle-details]. |
204 | 204 | //! |
205 | 205 | //! We call such a [`Pin`]-wrapped pointer a **pinning pointer,** (or pinning reference, or pinning |
206 | | -//! `Box`, etc.) because its existince is the thing that is *symbolically* pinning the underlying |
| 206 | +//! `Box`, etc.) because its existence is the thing that is conceptually pinning the underlying |
207 | 207 | //! pointee in place: it is the metaphorical "pin" securing the data in place on the pinboard |
208 | 208 | //! (in memory). |
209 | 209 | //! |
|
332 | 332 | //! |
333 | 333 | //! ## [`Unpin`] |
334 | 334 | //! |
335 | | -//! The vast majority of Rust types have no address-sensitive states; these types |
| 335 | +//! The vast majority of Rust types have no address-sensitive states. These types |
336 | 336 | //! implement the [`Unpin`] auto-trait, which cancels the restrictive effects of |
337 | 337 | //! [`Pin`] when the *pointee* type `T` is [`Unpin`]. When [`T: Unpin`][Unpin], |
338 | 338 | //! <code>[Pin]<[Box]\<T>></code> functions identically to a non-pinning [`Box<T>`]; similarly, |
|
0 commit comments