summary refs log tree commit diff
path: root/compiler/rustc_session/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-05-12 08:38:03 +0000
committerbors <bors@rust-lang.org>2021-05-12 08:38:03 +0000
commitac923d94f86a6f7c881ecbedcd0a68d7986a35bd (patch)
treeb6e833aafaa51f98d96634dd6f5657de2a23e9ea /compiler/rustc_session/src
parentc1e7e361f7cddd1fe9b3bfef71a6539d2570e4fb (diff)
parent163b4801e72a11803a6dcfece2099b11e5a9be76 (diff)
downloadrust-ac923d94f86a6f7c881ecbedcd0a68d7986a35bd.tar.gz
rust-ac923d94f86a6f7c881ecbedcd0a68d7986a35bd.zip
Auto merge of #83610 - bjorn3:driver_cleanup, r=cjgillot
rustc_driver cleanup

Best reviewed one commit at a time.
Diffstat (limited to 'compiler/rustc_session/src')
-rw-r--r--compiler/rustc_session/src/session.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/rustc_session/src/session.rs b/compiler/rustc_session/src/session.rs
index 66b0f5c11be..6d74723993b 100644
--- a/compiler/rustc_session/src/session.rs
+++ b/compiler/rustc_session/src/session.rs
@@ -1528,7 +1528,7 @@ pub enum IncrCompSession {
     InvalidBecauseOfErrors { session_directory: PathBuf },
 }
 
-pub fn early_error(output: config::ErrorOutputType, msg: &str) -> ! {
+pub fn early_error_no_abort(output: config::ErrorOutputType, msg: &str) {
     let emitter: Box<dyn Emitter + sync::Send> = match output {
         config::ErrorOutputType::HumanReadable(kind) => {
             let (short, color_config) = kind.unzip();
@@ -1540,6 +1540,10 @@ pub fn early_error(output: config::ErrorOutputType, msg: &str) -> ! {
     };
     let handler = rustc_errors::Handler::with_emitter(true, None, emitter);
     handler.struct_fatal(msg).emit();
+}
+
+pub fn early_error(output: config::ErrorOutputType, msg: &str) -> ! {
+    early_error_no_abort(output, msg);
     rustc_errors::FatalError.raise();
 }