about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2020-05-10 23:36:41 +0200
committerRalf Jung <post@ralfj.de>2020-05-10 23:36:41 +0200
commit30822733f080fdee42409a6e05c6b8c7adfbbe7f (patch)
tree0cba4a5401c4917b4983d7c5a92cbe5680ddf42f
parent51158cc71f43dc5986e1e503339ba093db5cc511 (diff)
downloadrust-30822733f080fdee42409a6e05c6b8c7adfbbe7f.tar.gz
rust-30822733f080fdee42409a6e05c6b8c7adfbbe7f.zip
rustc_driver: factor out computing the exit code
-rw-r--r--src/driver.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/driver.rs b/src/driver.rs
index 2c699998ea9..1ce0300f239 100644
--- a/src/driver.rs
+++ b/src/driver.rs
@@ -296,7 +296,7 @@ pub fn main() {
     rustc_driver::init_rustc_env_logger();
     lazy_static::initialize(&ICE_HOOK);
     exit(
-        rustc_driver::catch_fatal_errors(move || {
+        rustc_driver::catch_with_exit_code(move || {
             let mut orig_args: Vec<String> = env::args().collect();
 
             if orig_args.iter().any(|a| a == "--version" || a == "-V") {
@@ -411,7 +411,5 @@ pub fn main() {
                 if clippy_enabled { &mut clippy } else { &mut default };
             rustc_driver::run_compiler(&args, callbacks, None, None)
         })
-        .and_then(|result| result)
-        .is_err() as i32,
     )
 }