diff options
| author | yukang <moorekang@gmail.com> | 2022-11-03 09:22:08 +0800 |
|---|---|---|
| committer | yukang <moorekang@gmail.com> | 2022-11-03 09:22:08 +0800 |
| commit | a21a055ca6f0d0244cfe79ffba908987e475c946 (patch) | |
| tree | 655d28a015a0c24795a687e8a6c8beaad6fc37d3 /compiler | |
| parent | ab22f5521bdb940d8beabd442298a56ecb236b38 (diff) | |
| download | rust-a21a055ca6f0d0244cfe79ffba908987e475c946.tar.gz rust-a21a055ca6f0d0244cfe79ffba908987e475c946.zip | |
remove 'delay_span_bug' following 'references_error'
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_const_eval/src/transform/promote_consts.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/rustc_const_eval/src/transform/promote_consts.rs b/compiler/rustc_const_eval/src/transform/promote_consts.rs index f3ae16da43b..f48bcd90809 100644 --- a/compiler/rustc_const_eval/src/transform/promote_consts.rs +++ b/compiler/rustc_const_eval/src/transform/promote_consts.rs @@ -45,11 +45,10 @@ impl<'tcx> MirPass<'tcx> for PromoteTemps<'tcx> { // There's not really any point in promoting errorful MIR. // // This does not include MIR that failed const-checking, which we still try to promote. - if body.return_ty().references_error() { - tcx.sess.delay_span_bug(body.span, "PromoteTemps: MIR had errors"); + if let Err(_) = body.return_ty().error_reported() { + debug!("PromoteTemps: MIR had errors"); return; } - if body.source.promoted.is_some() { return; } |
