]> git.lizzy.rs Git - rust.git/commitdiff
Only emit save-analysis data for `cargo build` tasks
authorNick Cameron <ncameron@mozilla.com>
Tue, 17 Apr 2018 09:31:33 +0000 (21:31 +1200)
committerNick Cameron <ncameron@mozilla.com>
Tue, 17 Apr 2018 09:35:10 +0000 (21:35 +1200)
Previously, we were emittinng analysis data for all tasks, including `doc`. That meant we got two sets of save-analysis data, one from the normal build and one from the docs. That means indexing with the RLS took twice as long and made downloads larger and build times longer.

cc https://github.com/rust-lang-nursery/rls/issues/826

src/bootstrap/builder.rs

index 6874efa5a4c73f9941947a799d182c4b7f8070e4..484e8b9b7432f906a40e7d71bb4932e4f86392f4 100644 (file)
@@ -756,7 +756,9 @@ pub fn cargo(&self,
             }
         }
 
-        if mode == Mode::Libstd && self.config.extended && compiler.is_final_stage(self) {
+        if cmd == "build" && mode == Mode::Libstd
+            && self.config.extended && compiler.is_final_stage(self)
+        {
             cargo.env("RUSTC_SAVE_ANALYSIS", "api".to_string());
         }