File tree 1 file changed +12
-3
lines changed
1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -566,9 +566,18 @@ impl<'tcx> ty::ctxt<'tcx> {
566
566
}
567
567
}
568
568
569
- /// Returns true if this ADT is a dtorck type, i.e. whether it
570
- /// being safe for destruction requires all borrowed pointers
571
- /// reachable by it to have lifetimes strictly greater than self.
569
+ /// Returns true if this ADT is a dtorck type.
570
+ ///
571
+ /// Invoking the destructor of a dtorck type during usual cleanup
572
+ /// (e.g. the glue emitted for stack unwinding) requires all
573
+ /// lifetimes in the type-structure of `adt` to strictly outlive
574
+ /// the adt value itself.
575
+ ///
576
+ /// If `adt` is not dtorck, then the adt's destructor can be
577
+ /// invoked even when there are lifetimes in the type-structure of
578
+ /// `adt` that do not strictly outlive the adt value itself.
579
+ /// (This allows programs to make cyclic structures without
580
+ /// resorting to unasfe means; see RFCs 769 and 1238).
572
581
pub fn is_adt_dtorck ( & self , adt : ty:: AdtDef < ' tcx > ) -> bool {
573
582
let dtor_method = match adt. destructor ( ) {
574
583
Some ( dtor) => dtor,
You can’t perform that action at this time.
0 commit comments