File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -521,7 +521,7 @@ impl Build {
521521 . env ( format ! ( "CFLAGS_{}" , target) , self . cflags ( target) . join ( " " ) ) ;
522522 }
523523
524- if self . config . channel == "nightly" && compiler. stage == 2 {
524+ if self . config . channel == "nightly" && compiler. is_final_stage ( self ) {
525525 cargo. env ( "RUSTC_SAVE_ANALYSIS" , "api" . to_string ( ) ) ;
526526 }
527527
@@ -922,4 +922,13 @@ impl<'a> Compiler<'a> {
922922 fn is_snapshot ( & self , build : & Build ) -> bool {
923923 self . stage == 0 && self . host == build. config . build
924924 }
925+
926+ /// Returns if this compiler should be treated as a final stage one in the
927+ /// current build session.
928+ /// This takes into account whether we're performing a full bootstrap or
929+ /// not; don't directly compare the stage with `2`!
930+ fn is_final_stage ( & self , build : & Build ) -> bool {
931+ let final_stage = if build. config . full_bootstrap { 2 } else { 1 } ;
932+ self . stage >= final_stage
933+ }
925934}
You can’t perform that action at this time.
0 commit comments