1
Fork 0

Use ty_error_with_guaranteed in many more places

This commit is contained in:
Michael Goulet 2023-02-22 22:19:41 +00:00
parent fdbc4329cb
commit 1e7ef03b40
16 changed files with 306 additions and 226 deletions

View file

@ -2443,7 +2443,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
// the placeholder trait ref may fail due the Generalizer relation
// raising a CyclicalTy error due to a sub_root_var relation
// for a variable being generalized...
self.infcx.tcx.sess.delay_span_bug(
let guar = self.infcx.tcx.sess.delay_span_bug(
obligation.cause.span,
&format!(
"Impl {:?} was matchable against {:?} but now is not",
@ -2451,7 +2451,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
),
);
let value = self.infcx.fresh_substs_for_item(obligation.cause.span, impl_def_id);
let err = self.tcx().ty_error();
let err = self.tcx().ty_error_with_guaranteed(guar);
let value = value.fold_with(&mut BottomUpFolder {
tcx: self.tcx(),
ty_op: |_| err,