Skip to content

Commit

Permalink
Auto merge of #38736 - xen0n:save-the-save-analysis, r=alexcrichton
Browse files Browse the repository at this point in the history
rustbuild: save the save analysis

Fixes #38734. ~~call me the nightly firefighter~~

r? @alexcrichton
  • Loading branch information
bors committed Jan 1, 2017
2 parents 90c80e0 + e46d2d8 commit 07412c8
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/bootstrap/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

Expand Down Expand Up @@ -922,4 +922,13 @@ impl<'a> Compiler<'a> {
fn is_snapshot(&self, build: &Build) -> bool {
self.stage == 0 && self.host == build.config.build
}

/// 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
}
}

0 comments on commit 07412c8

Please sign in to comment.