rustbuild: check if compiler is final stage wrt the full bootstrap setting

This commit is contained in:
Wang Xuerui 2016-12-31 14:29:27 +08:00
parent b68d3293e3
commit 8d5b91a19f
No known key found for this signature in database
GPG key ID: 38544B4E2DE7FAB9

View file

@ -914,4 +914,12 @@ fn new(stage: u32, host: &'a str) -> Compiler<'a> {
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`!
fn is_final_stage(&self, build: &Build) -> bool {
let final_stage = if build.config.full_bootstrap { 2 } else { 1 };
self.stage >= final_stage
}
}