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
This commit is contained in:
Rémy Rakic 2018-07-04 00:31:12 +02:00
parent 739320a601
commit 0190286d48

View file

@ -307,6 +307,15 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
false // keep visiting
}
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
}
}
}
}
}