File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
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
@@ -915,9 +915,10 @@ impl<'a> Compiler<'a> {
915915 self . stage == 0 && self . host == build. config . build
916916 }
917917
918- /// Returns if this compiler is to be treated as a final stage one, whether
919- /// we're performing a full bootstrap or not. Don't do that by comparing
920- /// stages with `2`!
918+ /// Returns if this compiler should be treated as a final stage one in the
919+ /// current build session.
920+ /// This takes into account whether we're performing a full bootstrap or
921+ /// not; don't directly compare the stage with `2`!
921922 fn is_final_stage ( & self , build : & Build ) -> bool {
922923 let final_stage = if build. config . full_bootstrap { 2 } else { 1 } ;
923924 self . stage >= final_stage
You can’t perform that action at this time.
0 commit comments