about summary refs log tree commit diff
diff options
context:
space:
mode:
authorWang Xuerui <git@xen0n.name>2016-12-31 14:31:08 +0800
committerWang Xuerui <git@xen0n.name>2016-12-31 23:07:55 +0800
commite46d2d8ca2c56b500eac81ac647e9aee9862754d (patch)
tree1d805d6a35ae6142299d29d5ab782a4694da80d9
parent8d5b91a19f0992445a6b19f7c774cdeb54b7632a (diff)
downloadrust-e46d2d8ca2c56b500eac81ac647e9aee9862754d.tar.gz
rust-e46d2d8ca2c56b500eac81ac647e9aee9862754d.zip
rustbuild: fix save-analysis not being saved for 2-stage builds
-rw-r--r--src/bootstrap/lib.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs
index 804b56e7505..bef852493e3 100644
--- a/src/bootstrap/lib.rs
+++ b/src/bootstrap/lib.rs
@@ -521,7 +521,7 @@ impl Build {
                  .env(format!("CFLAGS_{}", target), self.cflags(target).join(" "));
         }
 
-        if self.config.channel == "nightly" && compiler.stage == 2 {
+        if self.config.channel == "nightly" && compiler.is_final_stage(self) {
             cargo.env("RUSTC_SAVE_ANALYSIS", "api".to_string());
         }
 
@@ -915,9 +915,10 @@ impl<'a> Compiler<'a> {
         self.stage == 0 && self.host == build.config.build
     }
 
-    /// Returns if this compiler is to be treated as a final stage one, whether
-    /// we're performing a full bootstrap or not. Don't do that by comparing
-    /// stages with `2`!
+    /// Returns if this compiler should be treated as a final stage one in the
+    /// current build session.
+    /// This takes into account whether we're performing a full bootstrap or
+    /// not; don't directly compare the stage with `2`!
     fn is_final_stage(&self, build: &Build) -> bool {
         let final_stage = if build.config.full_bootstrap { 2 } else { 1 };
         self.stage >= final_stage