about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBryanskiy <ivakin.kir@gmail.com>2024-08-01 17:44:00 +0300
committerBryanskiy <ivakin.kir@gmail.com>2024-08-01 17:44:14 +0300
commitc8a3cafc0fd995767bd59f2a57a0efa2cf8792cb (patch)
tree4ea122905c5318ac79d9e2c2174045c8d642f3ca
parent595316b4006932405a63862d8fe65f71a6356293 (diff)
downloadrust-c8a3cafc0fd995767bd59f2a57a0efa2cf8792cb.tar.gz
rust-c8a3cafc0fd995767bd59f2a57a0efa2cf8792cb.zip
fix dropck documentation for `[T;0]` special-case
-rw-r--r--library/core/src/ops/drop.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/library/core/src/ops/drop.rs b/library/core/src/ops/drop.rs
index 36ae581e3f7..c6083a121d1 100644
--- a/library/core/src/ops/drop.rs
+++ b/library/core/src/ops/drop.rs
@@ -171,12 +171,13 @@
 /// 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.
+///   neither `T` nor any of its (recursive) fields have a destructor (`impl Drop`). [`PhantomData`],
+///   arrays of length 0 and [`ManuallyDrop`] are considered to never have a destructor, no matter
+///   their field type.
 /// - If `T` has drop glue, then, for all types `U` that are *owned* by any field of `T`,
 ///   recursively add the types and lifetimes that need to be live when `U` gets dropped. The set of
 ///   owned types is determined by recursively traversing `T`:
-///   - Recursively descend through `PhantomData`, `Box`, tuples, and arrays (including arrays of
+///   - Recursively descend through `PhantomData`, `Box`, tuples, and arrays (excluding arrays of
 ///     length 0).
 ///   - Stop at reference and raw pointer types as well as function pointers and function items;
 ///     they do not own anything.