@@ -796,6 +796,21 @@ impl<'a> Builder<'a> {
796
796
cargo. env ( "RUST_CHECK" , "1" ) ;
797
797
}
798
798
799
+ let stage;
800
+ if compiler. stage == 0 && self . local_rebuild {
801
+ // Assume the local-rebuild rustc already has stage1 features.
802
+ stage = 1 ;
803
+ } else {
804
+ stage = compiler. stage ;
805
+ }
806
+
807
+ let mut rustflags = Rustflags :: new ( ) ;
808
+ if stage != 0 {
809
+ rustflags. env ( "RUSTFLAGS_NOT_BOOTSTRAP" ) ;
810
+ } else {
811
+ rustflags. env ( "RUSTFLAGS_BOOTSTRAP" ) ;
812
+ }
813
+
799
814
match mode {
800
815
Mode :: Std | Mode :: ToolBootstrap | Mode :: ToolStd => { } ,
801
816
Mode :: Rustc | Mode :: Codegen | Mode :: ToolRustc => {
@@ -852,22 +867,6 @@ impl<'a> Builder<'a> {
852
867
}
853
868
cargo. env ( "__CARGO_DEFAULT_LIB_METADATA" , & metadata) ;
854
869
855
- let stage;
856
- if compiler. stage == 0 && self . local_rebuild {
857
- // Assume the local-rebuild rustc already has stage1 features.
858
- stage = 1 ;
859
- } else {
860
- stage = compiler. stage ;
861
- }
862
-
863
- let mut rustflags = Rustflags :: new ( ) ;
864
- rustflags. env ( & format ! ( "RUSTFLAGS_STAGE_{}" , stage) ) ;
865
- if stage != 0 {
866
- rustflags. env ( "RUSTFLAGS_NOT_BOOTSTRAP" ) ;
867
- } else {
868
- rustflags. env ( "RUSTFLAGS_BOOTSTRAP" ) ;
869
- }
870
-
871
870
if cmd == "clippy" {
872
871
rustflags. arg ( "-Zforce-unstable-if-unmarked" ) ;
873
872
}
@@ -1064,7 +1063,11 @@ impl<'a> Builder<'a> {
1064
1063
&& self . config . extended
1065
1064
&& compiler. is_final_stage ( self )
1066
1065
{
1067
- cargo. env ( "RUSTC_SAVE_ANALYSIS" , "api" . to_string ( ) ) ;
1066
+ rustflags. arg ( "-Zsave-analysis" ) ;
1067
+ cargo. env ( "RUST_SAVE_ANALYSIS_CONFIG" ,
1068
+ "{\" output_file\" : null,\" full_docs\" : false,\
1069
+ \" pub_only\" : true,\" reachable_only\" : false,\
1070
+ \" distro_crate\" : true,\" signatures\" : false,\" borrow_data\" : false}") ;
1068
1071
}
1069
1072
1070
1073
// For `cargo doc` invocations, make rustdoc print the Rust version into the docs
0 commit comments