Rollup merge of #128497 - Bryanskiy:fix-dropck-doc, r=lcnr · model-checking/verify-rust-std@fb966d2 (original) (raw)
`@@ -171,12 +171,13 @@
`
171
171
`` /// still be live when T
gets dropped. The exact details of this analysis are not yet
``
172
172
`/// stably guaranteed and subject to change. Currently, the analysis works as follows:
`
173
173
`` /// - If T
has no drop glue, then trivially nothing is required to be live. This is the case if
``
174
``
`` -
/// neither T
nor any of its (recursive) fields have a destructor (impl Drop
). [PhantomData
]
``
175
``
`` -
/// and [ManuallyDrop
] are considered to never have a destructor, no matter their field type.
``
``
174
`` +
/// neither T
nor any of its (recursive) fields have a destructor (impl Drop
). [PhantomData
],
``
``
175
`` +
/// arrays of length 0 and [ManuallyDrop
] are considered to never have a destructor, no matter
``
``
176
`+
/// their field type.
`
176
177
`` /// - If T
has drop glue, then, for all types U
that are owned by any field of T
,
``
177
178
`` /// recursively add the types and lifetimes that need to be live when U
gets dropped. The set of
``
178
179
`` /// owned types is determined by recursively traversing T
:
``
179
``
`` -
/// - Recursively descend through PhantomData
, Box
, tuples, and arrays (including arrays of
``
``
180
`` +
/// - Recursively descend through PhantomData
, Box
, tuples, and arrays (excluding arrays of
``
180
181
`/// length 0).
`
181
182
`/// - Stop at reference and raw pointer types as well as function pointers and function items;
`
182
183
`/// they do not own anything.
`