未验证 提交 e46d2d8c 编写于 作者: W Wang Xuerui

rustbuild: fix save-analysis not being saved for 2-stage builds

上级 8d5b91a1
......@@ -521,7 +521,7 @@ fn cargo(&self,
.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 @@ fn is_snapshot(&self, build: &Build) -> bool {
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册