Convert delayed_bug
s to bug
s.
I have a suspicion that quite a few delayed bug paths are impossible to reach, so I did an experiment. I converted every `delayed_bug` to a `bug`, ran the full test suite, then converted back every `bug` that was hit. A surprising number were never hit. The next commit will convert some more back, based on human judgment.
This commit is contained in:
parent
bb594538fc
commit
010f3944e0
44 changed files with 87 additions and 157 deletions
|
@ -303,7 +303,7 @@ where
|
|||
// Ignore this, we presume it will yield an error later,
|
||||
// since if a type variable is not resolved by this point
|
||||
// it never will be.
|
||||
self.tcx.dcx().span_delayed_bug(
|
||||
self.tcx.dcx().span_bug(
|
||||
origin.span(),
|
||||
format!("unresolved inference variable in outlives: {v:?}"),
|
||||
);
|
||||
|
|
|
@ -175,11 +175,7 @@ impl<'cx, 'tcx> VerifyBoundCx<'cx, 'tcx> {
|
|||
// Ignore this, we presume it will yield an error later, since
|
||||
// if a type variable is not resolved by this point it never
|
||||
// will be.
|
||||
self.tcx
|
||||
.dcx()
|
||||
.delayed_bug(format!("unresolved inference variable in outlives: {v:?}"));
|
||||
// Add a bound that never holds.
|
||||
VerifyBound::AnyBound(vec![])
|
||||
self.tcx.dcx().bug(format!("unresolved inference variable in outlives: {v:?}"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -420,11 +420,9 @@ where
|
|||
match b.kind() {
|
||||
ty::ConstKind::Infer(InferConst::Var(_)) if D::forbid_inference_vars() => {
|
||||
// Forbid inference variables in the RHS.
|
||||
self.infcx.dcx().span_delayed_bug(
|
||||
self.delegate.span(),
|
||||
format!("unexpected inference var {b:?}",),
|
||||
);
|
||||
Ok(a)
|
||||
self.infcx
|
||||
.dcx()
|
||||
.span_bug(self.delegate.span(), format!("unexpected inference var {b:?}",));
|
||||
}
|
||||
// FIXME(invariance): see the related FIXME above.
|
||||
_ => self.infcx.super_combine_consts(self, a, b),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue