about summary refs log tree commit diff
path: root/compiler/rustc_interface/src
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2024-02-19 10:23:58 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2024-02-22 08:03:47 +1100
commit4da67fff61ccc460370df6047563f8091c7e66bd (patch)
tree761249125161b8904d059dadc89e77225b664114 /compiler/rustc_interface/src
parent44006444c8c85a0102984a4323755da0084a681e (diff)
downloadrust-4da67fff61ccc460370df6047563f8091c7e66bd.tar.gz
rust-4da67fff61ccc460370df6047563f8091c7e66bd.zip
Replace unnecessary `abort_if_errors`.
Replace `abort_if_errors` calls that are certain to abort -- because
we emit an error immediately beforehand -- with `FatalErro.raise()`.
Diffstat (limited to 'compiler/rustc_interface/src')
-rw-r--r--compiler/rustc_interface/src/passes.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/compiler/rustc_interface/src/passes.rs b/compiler/rustc_interface/src/passes.rs
index d35c2be1fb4..66140168759 100644
--- a/compiler/rustc_interface/src/passes.rs
+++ b/compiler/rustc_interface/src/passes.rs
@@ -936,9 +936,7 @@ pub fn start_codegen<'tcx>(
 
     if tcx.sess.opts.output_types.contains_key(&OutputType::Mir) {
         if let Err(error) = rustc_mir_transform::dump_mir::emit_mir(tcx) {
-            let dcx = tcx.dcx();
-            dcx.emit_err(errors::CantEmitMIR { error });
-            dcx.abort_if_errors();
+            tcx.dcx().emit_fatal(errors::CantEmitMIR { error });
         }
     }