Skip to content
Permalink
Browse files

Delay ICE in fold_region so feature gate has chance to stop compilati…

…on cleanly.
  • Loading branch information...
pnkfelix committed May 24, 2019
1 parent 4680580 commit 698e50f98548cfdf36599bb975609c816567f709
Showing with 5 additions and 4 deletions.
  1. +5 −4 src/librustc/ty/subst.rs
@@ -479,21 +479,22 @@ impl<'a, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for SubstFolder<'a, 'gcx, 'tcx> {
// the specialized routine `ty::replace_late_regions()`.
match *r {
ty::ReEarlyBound(data) => {
let r = self.substs.get(data.index as usize).map(|k| k.unpack());
match r {
let rk = self.substs.get(data.index as usize).map(|k| k.unpack());
match rk {
Some(UnpackedKind::Lifetime(lt)) => {
self.shift_region_through_binders(lt)
}
_ => {
let span = self.span.unwrap_or(DUMMY_SP);
span_bug!(
span,
let msg = format!(
"Region parameter out of range \
when substituting in region {} (root type={:?}) \
(index={})",
data.name,
self.root_ty,
data.index);
self.tcx.sess.delay_span_bug(span, &msg);
r
}
}
}

0 comments on commit 698e50f

Please sign in to comment.
You can’t perform that action at this time.