Skip to content

Commit

Permalink
NLL Liveness: Skip regionless types when visiting free regions
Browse files Browse the repository at this point in the history
The tuple-stress benchmark exercises the liveness constraint generation code for types which do not have regions
  • Loading branch information
lqd committed Jul 4, 2018
1 parent 739320a commit 0190286
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/librustc/ty/fold.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
}
}
Expand Down

0 comments on commit 0190286

Please sign in to comment.