@@ -12,9 +12,9 @@ type NeedsDropResult<T> = Result<T, AlwaysRequiresDrop>;
1212fn needs_drop_raw < ' tcx > ( tcx : TyCtxt < ' tcx > , query : ty:: ParamEnvAnd < ' tcx , Ty < ' tcx > > ) -> bool {
1313 let adt_fields =
1414 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.
1818 let res = NeedsDropTypes :: new ( tcx, query. param_env , query. value , adt_fields) . next ( ) . is_some ( ) ;
1919 debug ! ( "needs_drop_raw({:?}) = {:?}" , query, res) ;
2020 res
@@ -25,9 +25,10 @@ struct NeedsDropTypes<'tcx, F> {
2525 param_env : ty:: ParamEnv < ' tcx > ,
2626 query_ty : Ty < ' tcx > ,
2727 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.
3132 unchecked_tys : Vec < ( Ty < ' tcx > , usize ) > ,
3233 recursion_limit : usize ,
3334 adt_components : F ,
0 commit comments