1
Fork 0

Avoid some tls::with calls.

These are in places where a `tcx` is easily obtained.
This commit is contained in:
Nicholas Nethercote 2023-02-09 10:51:29 +11:00
parent 18f751df6a
commit afbe167fbb
3 changed files with 8 additions and 11 deletions

View file

@ -203,12 +203,10 @@ impl CanonicalizeMode for CanonicalizeQueryResponse {
// 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(|tcx| {
tcx.sess.delay_span_bug(
rustc_span::DUMMY_SP,
&format!("unexpected region in query response: `{:?}`", r),
);
});
canonicalizer.tcx.sess.delay_span_bug(
rustc_span::DUMMY_SP,
&format!("unexpected region in query response: `{:?}`", r),
);
r
}
}