Auto merge of #52037 - lqd:skipping-regionless-types, r=nikomatsakis

NLL Liveness: Skip regionless types when visiting free regions

The tuple-stress benchmark exercises the liveness constraint generation code for types which do not have regions

Closes #52027
This commit is contained in:
bors 2018-07-07 07:06:14 +00:00
commit 599d2c01e0

View File

@ -325,6 +325,15 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
_ => (self.callback)(r),
}
}
fn visit_ty(&mut self, ty: Ty<'tcx>) -> bool {
// We're only interested in types involving regions
if ty.flags.intersects(TypeFlags::HAS_FREE_REGIONS) {
ty.super_visit_with(self)
} else {
false // keep visiting
}
}
}
}
}