diff options
| author | Ralf Jung <post@ralfj.de> | 2023-05-12 15:25:24 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2023-05-12 15:28:51 +0200 |
| commit | b93fd8355acbe8a4ffd53ad32c3d7f4798c15b98 (patch) | |
| tree | 2d2ac35b29bd881c33c392e472cf11e95e2d3dab | |
| parent | 967ebb9c3d21d1692b0fa51112eee71c1b4668c4 (diff) | |
| download | rust-b93fd8355acbe8a4ffd53ad32c3d7f4798c15b98.tar.gz rust-b93fd8355acbe8a4ffd53ad32c3d7f4798c15b98.zip | |
hedge for future changes
Co-authored-by: lcnr <rust@lcnr.de>
| -rw-r--r-- | library/core/src/marker.rs | 8 | ||||
| -rw-r--r-- | library/core/src/ops/drop.rs | 3 |
2 files changed, 7 insertions, 4 deletions
diff --git a/library/core/src/marker.rs b/library/core/src/marker.rs index de285c99cb1..2e8cab8601a 100644 --- a/library/core/src/marker.rs +++ b/library/core/src/marker.rs @@ -668,9 +668,11 @@ impl<T: ?Sized> !Sync for *mut T {} /// /// ## Ownership and the drop check /// -/// Adding a field of type `PhantomData<T>` indicates that your type *owns* data of type `T`. This -/// in turn has effects on the Rust compiler's [drop check] analysis, but that only matters in very -/// specific circumstances. For the exact rules, see the [drop check] documentation. +/// The exact interaction of `PhantomData` with drop check **may change in the future**. +/// +/// Currently, adding a field of type `PhantomData<T>` indicates that your type *owns* data of type +/// `T` in very rare circumstances. This in turn has effects on the Rust compiler's [drop check] +/// analysis. For the exact rules, see the [drop check] documentation. /// /// ## Layout /// diff --git a/library/core/src/ops/drop.rs b/library/core/src/ops/drop.rs index 804d2c775fc..9ebf426be95 100644 --- a/library/core/src/ops/drop.rs +++ b/library/core/src/ops/drop.rs @@ -168,7 +168,8 @@ /// The Nomicon discusses the need for [drop check in more detail][drop check]. /// /// To reject such code, the "drop check" analysis determines which types and lifetimes need to -/// still be live when `T` gets dropped: +/// still be live when `T` gets dropped. The exact details of this analysis are not yet +/// stably guaranteed and **subject to change**. Currently, the analysis works as follows: /// - If `T` has no drop glue, then trivially nothing is required to be live. This is the case if /// neither `T` nor any of its (recursive) fields have a destructor (`impl Drop`). [`PhantomData`] /// and [`ManuallyDrop`] are considered to never have a destructor, no matter their field type. |
