Skip to content

Commit 0190286

Browse files
committed
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
1 parent 739320a commit 0190286

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/librustc/ty/fold.rs

+9
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,15 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
307307

308308
false // keep visiting
309309
}
310+
311+
fn visit_ty(&mut self, ty: Ty<'tcx>) -> bool {
312+
// We're only interested in types involving regions
313+
if ty.flags.intersects(TypeFlags::HAS_FREE_REGIONS) {
314+
ty.super_visit_with(self)
315+
} else {
316+
false // keep visiting
317+
}
318+
}
310319
}
311320
}
312321
}

0 commit comments

Comments
 (0)