@@ -12,9 +12,9 @@ type NeedsDropResult<T> = Result<T, AlwaysRequiresDrop>;
12
12
fn needs_drop_raw < ' tcx > ( tcx : TyCtxt < ' tcx > , query : ty:: ParamEnvAnd < ' tcx , Ty < ' tcx > > ) -> bool {
13
13
let adt_fields =
14
14
move |adt_def : & ty:: AdtDef | tcx. adt_drop_tys ( adt_def. did ) . map ( |tys| tys. iter ( ) . copied ( ) ) ;
15
- // If we don't know a type doesn't need drop, say it's a type parameter
16
- // without a `Copy` bound, then we conservatively return that it needs
17
- // drop.
15
+ // If we don't know a type doesn't need drop, for example if it's a type
16
+ // parameter without a `Copy` bound, then we conservatively return that it
17
+ // needs drop.
18
18
let res = NeedsDropTypes :: new ( tcx, query. param_env , query. value , adt_fields) . next ( ) . is_some ( ) ;
19
19
debug ! ( "needs_drop_raw({:?}) = {:?}" , query, res) ;
20
20
res
@@ -25,9 +25,10 @@ struct NeedsDropTypes<'tcx, F> {
25
25
param_env : ty:: ParamEnv < ' tcx > ,
26
26
query_ty : Ty < ' tcx > ,
27
27
seen_tys : FxHashSet < Ty < ' tcx > > ,
28
- /// A stack of types left to process. Each round, we pop something from the
29
- /// stack and check if it needs drop. If the result depends on whether some
30
- /// other types need drop we push them onto the stack.
28
+ /// A stack of types left to process, and the recursion depth when we
29
+ /// pushed that type. Each round, we pop something from the stack and check
30
+ /// if it needs drop. If the result depends on whether some other types
31
+ /// need drop we push them onto the stack.
31
32
unchecked_tys : Vec < ( Ty < ' tcx > , usize ) > ,
32
33
recursion_limit : usize ,
33
34
adt_components : F ,
0 commit comments