File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -668,9 +668,11 @@ impl<T: ?Sized> !Sync for *mut T {}
668668///
669669/// ## Ownership and the drop check
670670///
671- /// Adding a field of type `PhantomData<T>` indicates that your type *owns* data of type `T`. This
672- /// in turn has effects on the Rust compiler's [drop check] analysis, but that only matters in very
673- /// specific circumstances. For the exact rules, see the [drop check] documentation.
671+ /// The exact interaction of `PhantomData` with drop check **may change in the future**.
672+ ///
673+ /// Currently, adding a field of type `PhantomData<T>` indicates that your type *owns* data of type
674+ /// `T` in very rare circumstances. This in turn has effects on the Rust compiler's [drop check]
675+ /// analysis. For the exact rules, see the [drop check] documentation.
674676///
675677/// ## Layout
676678///
Original file line number Diff line number Diff line change 168168/// The Nomicon discusses the need for [drop check in more detail][drop check].
169169///
170170/// To reject such code, the "drop check" analysis determines which types and lifetimes need to
171- /// still be live when `T` gets dropped:
171+ /// still be live when `T` gets dropped. The exact details of this analysis are not yet
172+ /// stably guaranteed and **subject to change**. Currently, the analysis works as follows:
172173/// - If `T` has no drop glue, then trivially nothing is required to be live. This is the case if
173174/// neither `T` nor any of its (recursive) fields have a destructor (`impl Drop`). [`PhantomData`]
174175/// and [`ManuallyDrop`] are considered to never have a destructor, no matter their field type.
You can’t perform that action at this time.
0 commit comments