Skip to content

Commit b93fd83

Browse files
RalfJunglcnr
andcommitted
hedge for future changes
Co-authored-by: lcnr <[email protected]>
1 parent 967ebb9 commit b93fd83

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

library/core/src/marker.rs

+5-3
Original file line numberDiff line numberDiff 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
///

library/core/src/ops/drop.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,8 @@
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.

0 commit comments

Comments
 (0)