about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2024-02-16 15:26:42 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2024-02-22 08:03:47 +1100
commit9919c3dab3e4eabe466612de5f6c472e3e27ceb6 (patch)
tree3b2d175de30b4f3192c2d04bc4790e13a07c46c1
parent203b4332bb3da3af092344b3459416aeab4c90ef (diff)
downloadrust-9919c3dab3e4eabe466612de5f6c472e3e27ceb6.tar.gz
rust-9919c3dab3e4eabe466612de5f6c472e3e27ceb6.zip
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.
-rw-r--r--compiler/rustc_driver_impl/src/lib.rs5
-rw-r--r--compiler/rustc_session/src/session.rs4
2 files changed, 2 insertions, 7 deletions
diff --git a/compiler/rustc_driver_impl/src/lib.rs b/compiler/rustc_driver_impl/src/lib.rs
index 60f11b1bdd4..9b2d760282f 100644
--- a/compiler/rustc_driver_impl/src/lib.rs
+++ b/compiler/rustc_driver_impl/src/lib.rs
@@ -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;
diff --git a/compiler/rustc_session/src/session.rs b/compiler/rustc_session/src/session.rs
index 9d1133c487f..422bbadf6a8 100644
--- a/compiler/rustc_session/src/session.rs
+++ b/compiler/rustc_session/src/session.rs
@@ -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.