Skip to content

Commit aff37f8

Browse files
committed
Clean up debug statements in needs_drop
1 parent eae42fd commit aff37f8

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

compiler/rustc_ty_utils/src/needs_drop.rs

+5-7
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ where
136136
// `ManuallyDrop`. If it's a struct or enum without a `Drop`
137137
// impl then check whether the field types need `Drop`.
138138
ty::Adt(adt_def, substs) => {
139-
debug!("Got value {:?} with substs {:?}", adt_def, substs);
140139
let tys = match (self.adt_components)(adt_def, substs) {
141140
Err(e) => return Some(Err(e)),
142141
Ok(tys) => tys,
@@ -190,16 +189,16 @@ fn drop_tys_helper<'tcx>(
190189
) -> impl Iterator<Item = NeedsDropResult<Ty<'tcx>>> {
191190
let adt_components = move |adt_def: &ty::AdtDef, substs: SubstsRef<'tcx>| {
192191
if adt_def.is_manually_drop() {
193-
debug!("adt_drop_tys: `{:?}` is manually drop", adt_def);
192+
debug!("drop_tys_helper: `{:?}` is manually drop", adt_def);
194193
return Ok(Vec::new().into_iter());
195194
} else if let Some(dtor_info) = adt_has_dtor(adt_def) {
196195
match dtor_info {
197196
DtorType::Significant => {
198-
debug!("adt_drop_tys: `{:?}` implements `Drop`", adt_def);
197+
debug!("drop_tys_helper: `{:?}` implements `Drop`", adt_def);
199198
return Err(AlwaysRequiresDrop);
200199
}
201200
DtorType::Insignificant => {
202-
debug!("adt_drop_tys: `{:?}` drop is insignificant", adt_def);
201+
debug!("drop_tys_helper: `{:?}` drop is insignificant", adt_def);
203202

204203
// Since the destructor is insignificant, we just want to make sure all of
205204
// the passed in type parameters are also insignificant.
@@ -208,15 +207,14 @@ fn drop_tys_helper<'tcx>(
208207
}
209208
}
210209
} else if adt_def.is_union() {
211-
debug!("adt_drop_tys: `{:?}` is a union", adt_def);
210+
debug!("drop_tys_helper: `{:?}` is a union", adt_def);
212211
return Ok(Vec::new().into_iter());
213212
}
214-
debug!("Path");
215213
Ok(adt_def
216214
.all_fields()
217215
.map(|field| {
218216
let r = tcx.type_of(field.did).subst(tcx, substs);
219-
debug!("Subst into {:?} with {:?} gettng {:?}", field, substs, r);
217+
debug!("drop_tys_helper: Subst into {:?} with {:?} gettng {:?}", field, substs, r);
220218
r
221219
})
222220
.collect::<Vec<_>>()

0 commit comments

Comments
 (0)