Skip to content

Commit a21a055

Browse files
committed
remove 'delay_span_bug' following 'references_error'
1 parent ab22f55 commit a21a055

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

compiler/rustc_const_eval/src/transform/promote_consts.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,10 @@ impl<'tcx> MirPass<'tcx> for PromoteTemps<'tcx> {
4545
// There's not really any point in promoting errorful MIR.
4646
//
4747
// This does not include MIR that failed const-checking, which we still try to promote.
48-
if body.return_ty().references_error() {
49-
tcx.sess.delay_span_bug(body.span, "PromoteTemps: MIR had errors");
48+
if let Err(_) = body.return_ty().error_reported() {
49+
debug!("PromoteTemps: MIR had errors");
5050
return;
5151
}
52-
5352
if body.source.promoted.is_some() {
5453
return;
5554
}

0 commit comments

Comments
 (0)