let result = item_substs
.iter()
.zip(impl_substs.iter())
- .filter(|&(_, &k)| {
+ .filter(|&(_, k)| {
match k.unpack() {
GenericArgKind::Lifetime(&ty::RegionKind::ReEarlyBound(ref ebr)) => {
!impl_generics.region_param(ebr, self).pure_wrt_drop
}
}
})
- .map(|(&item_param, _)| item_param)
+ .map(|(item_param, _)| item_param)
.collect();
debug!("destructor_constraint({:?}) = {:?}", def.did, result);
result
// Find non representable fields with their spans
fold_repr(def.all_fields().map(|field| {
let ty = field.ty(tcx, substs);
- let span = tcx.hir().span_if_local(field.did).unwrap_or(sp);
+ let span = match field
+ .did
+ .as_local()
+ .map(|id| tcx.hir().as_local_hir_id(id))
+ .and_then(|id| tcx.hir().find(id))
+ {
+ Some(hir::Node::Field(field)) => field.ty.span,
+ _ => sp,
+ };
match is_type_structurally_recursive(
tcx,
span,