about summary refs log tree commit diff
path: root/src/librustc_driver
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2017-03-10 16:51:32 -0600
committerAlex Crichton <alex@alexcrichton.com>2017-03-10 16:18:28 -0800
commit2b1d1bbf2abf2aac43f1eaa426f5597ea6a8bc4d (patch)
treee0ca5366022947af0a0b6a266c76bd2b67921e17 /src/librustc_driver
parentc1c3b09f286b06ec9a0ee328461330ef37f44548 (diff)
parent5c8aa74d26ba1dd4439d6d273ea32daa11f28851 (diff)
downloadrust-2b1d1bbf2abf2aac43f1eaa426f5597ea6a8bc4d.tar.gz
rust-2b1d1bbf2abf2aac43f1eaa426f5597ea6a8bc4d.zip
Rollup merge of #40336 - alexcrichton:fast-dep-info, r=nrc
rustc: Exit quickly on only `--emit dep-info`

This commit alters the compiler to exit quickly if the only output being emitted
is `dep-info`, which doesn't need a lot of other information to generate.

Closes #40328
Diffstat (limited to 'src/librustc_driver')
-rw-r--r--src/librustc_driver/driver.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/librustc_driver/driver.rs b/src/librustc_driver/driver.rs
index dda118fb440..2d08817e2a0 100644
--- a/src/librustc_driver/driver.rs
+++ b/src/librustc_driver/driver.rs
@@ -125,6 +125,10 @@ pub fn compile_input(sess: &Session,
         };
 
         write_out_deps(sess, &outputs, &crate_name);
+        if sess.opts.output_types.contains_key(&OutputType::DepInfo) &&
+            sess.opts.output_types.keys().count() == 1 {
+            return Ok(())
+        }
 
         let arena = DroplessArena::new();
         let arenas = GlobalArenas::new();