Skip to content

Commit

Permalink
Fix #57979 by allowing a legitimate type error to take precedence ove…
Browse files Browse the repository at this point in the history
…r an ICE.
  • Loading branch information
pnkfelix committed Feb 22, 2019
1 parent f47ec2a commit 4f89846
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/librustc/infer/canonical/canonicalizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,16 @@ impl CanonicalizeRegionMode for CanonicalizeQueryResponse {
// response should be executing in a fully
// canonicalized environment, so there shouldn't be
// any other region names it can come up.
bug!("unexpected region in query response: `{:?}`", r)
//
// rust-lang/rust#57464: `impl Trait` can leak local
// scopes (in manner violating typeck). Therefore, use
// `delay_span_bug` to allow type error over an ICE.
ty::tls::with_context(|c| {
c.tcx.sess.delay_span_bug(
syntax_pos::DUMMY_SP,
&format!("unexpected region in query response: `{:?}`", r));
});
r
}
}
}
Expand Down

0 comments on commit 4f89846

Please sign in to comment.