Skip to content

Commit

Permalink
Remove EarlyDiagCtxt::abort_if_errors.
Browse files Browse the repository at this point in the history
Its one use isn't necessary, because it's not possible for errors to
have been emitted at that point.
  • Loading branch information
nnethercote committed Feb 21, 2024
1 parent 203b433 commit 9919c3d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
5 changes: 2 additions & 3 deletions compiler/rustc_driver_impl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -349,11 +349,10 @@ fn run_compiler(
},
};

callbacks.config(&mut config);

default_early_dcx.abort_if_errors();
drop(default_early_dcx);

callbacks.config(&mut config);

interface::run_compiler(config, |compiler| {
let sess = &compiler.sess;
let codegen_backend = &*compiler.codegen_backend;
Expand Down
4 changes: 0 additions & 4 deletions compiler/rustc_session/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1410,10 +1410,6 @@ impl EarlyDiagCtxt {
Self { dcx: DiagCtxt::with_emitter(emitter) }
}

pub fn abort_if_errors(&self) {
self.dcx.abort_if_errors()
}

/// Swap out the underlying dcx once we acquire the user's preference on error emission
/// format. Any errors prior to that will cause an abort and all stashed diagnostics of the
/// previous dcx will be emitted.
Expand Down

0 comments on commit 9919c3d

Please sign in to comment.