Skip to content

Commit 9919c3d

Browse files
committed
Remove EarlyDiagCtxt::abort_if_errors.
Its one use isn't necessary, because it's not possible for errors to have been emitted at that point.
1 parent 203b433 commit 9919c3d

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

Diff for: compiler/rustc_driver_impl/src/lib.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -349,11 +349,10 @@ fn run_compiler(
349349
},
350350
};
351351

352-
callbacks.config(&mut config);
353-
354-
default_early_dcx.abort_if_errors();
355352
drop(default_early_dcx);
356353

354+
callbacks.config(&mut config);
355+
357356
interface::run_compiler(config, |compiler| {
358357
let sess = &compiler.sess;
359358
let codegen_backend = &*compiler.codegen_backend;

Diff for: compiler/rustc_session/src/session.rs

-4
Original file line numberDiff line numberDiff line change
@@ -1410,10 +1410,6 @@ impl EarlyDiagCtxt {
14101410
Self { dcx: DiagCtxt::with_emitter(emitter) }
14111411
}
14121412

1413-
pub fn abort_if_errors(&self) {
1414-
self.dcx.abort_if_errors()
1415-
}
1416-
14171413
/// Swap out the underlying dcx once we acquire the user's preference on error emission
14181414
/// format. Any errors prior to that will cause an abort and all stashed diagnostics of the
14191415
/// previous dcx will be emitted.

0 commit comments

Comments
 (0)