Use delay_span_bug for mismatched subst/hir arg
This commit is contained in:
parent
9503ea19ed
commit
a491f51218
3 changed files with 72 additions and 7 deletions
|
@ -634,14 +634,11 @@ impl<'tcx> MirBorrowckCtxt<'_, 'tcx> {
|
|||
| GenericArgKind::Const(_),
|
||||
_,
|
||||
) => {
|
||||
// I *think* that HIR lowering should ensure this
|
||||
// doesn't happen, even in erroneous
|
||||
// programs. Else we should use delay-span-bug.
|
||||
span_bug!(
|
||||
// HIR lowering is insufficient in erroneous programs, so
|
||||
// we need to use delay_span_bug here. See #82126.
|
||||
self.infcx.tcx.sess.delay_span_bug(
|
||||
hir_arg.span(),
|
||||
"unmatched subst and hir arg: found {:?} vs {:?}",
|
||||
kind,
|
||||
hir_arg,
|
||||
&format!("unmatched subst and hir arg: found {:?} vs {:?}", kind, hir_arg),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue