Skip to content

Commit

Permalink
Auto merge of rust-lang#52037 - lqd:skipping-regionless-types, r=niko…
Browse files Browse the repository at this point in the history
…matsakis

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 rust-lang#52027
  • Loading branch information
bors committed Jul 7, 2018
2 parents 4f0ca92 + 0190286 commit 599d2c0
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 @@ -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
}
}
}
}
}
Expand Down

0 comments on commit 599d2c0

Please sign in to comment.