1
Fork 0

Use delay_span_bug for mismatched subst/hir arg

This commit is contained in:
Edward Shen 2021-02-14 23:59:45 -05:00
parent 9503ea19ed
commit a491f51218
No known key found for this signature in database
GPG key ID: 19182661E818369F
3 changed files with 72 additions and 7 deletions

View file

@ -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),
);
}
}