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()`.
This commit is contained in:
Nicholas Nethercote 2024-02-19 10:23:58 +11:00
parent 44006444c8
commit 4da67fff61
6 changed files with 13 additions and 23 deletions

View file

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