Skip to content

Commit 04cb065

Browse files
committed
bootstrap: Remove need for RUSTC_SAVE_ANALYSIS
1 parent d63e2de commit 04cb065

File tree

2 files changed

+20
-26
lines changed

2 files changed

+20
-26
lines changed

src/bootstrap/bin/rustc.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -184,15 +184,6 @@ fn main() {
184184
cmd.arg("-C").arg(format!("codegen-units={}", s));
185185
}
186186

187-
// Emit save-analysis info.
188-
if env::var("RUSTC_SAVE_ANALYSIS") == Ok("api".to_string()) {
189-
cmd.arg("-Zsave-analysis");
190-
cmd.env("RUST_SAVE_ANALYSIS_CONFIG",
191-
"{\"output_file\": null,\"full_docs\": false,\
192-
\"pub_only\": true,\"reachable_only\": false,\
193-
\"distro_crate\": true,\"signatures\": false,\"borrow_data\": false}");
194-
}
195-
196187
// Dealing with rpath here is a little special, so let's go into some
197188
// detail. First off, `-rpath` is a linker option on Unix platforms
198189
// which adds to the runtime dynamic loader path when looking for

src/bootstrap/builder.rs

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -796,6 +796,21 @@ impl<'a> Builder<'a> {
796796
cargo.env("RUST_CHECK", "1");
797797
}
798798

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+
799814
match mode {
800815
Mode::Std | Mode::ToolBootstrap | Mode::ToolStd => {},
801816
Mode::Rustc | Mode::Codegen | Mode::ToolRustc => {
@@ -852,22 +867,6 @@ impl<'a> Builder<'a> {
852867
}
853868
cargo.env("__CARGO_DEFAULT_LIB_METADATA", &metadata);
854869

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-
871870
if cmd == "clippy" {
872871
rustflags.arg("-Zforce-unstable-if-unmarked");
873872
}
@@ -1064,7 +1063,11 @@ impl<'a> Builder<'a> {
10641063
&& self.config.extended
10651064
&& compiler.is_final_stage(self)
10661065
{
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}");
10681071
}
10691072

10701073
// For `cargo doc` invocations, make rustdoc print the Rust version into the docs

0 commit comments

Comments
 (0)