Skip to content

Commit 557e69b

Browse files
committed
bootstrap: Delete handling of RUSTC_METADATA_SUFFIX
This is already handled by `__CARGO_DEFAULT_LIB_METADATA` so there's no need to doubly do it.
1 parent f6c87ab commit 557e69b

File tree

2 files changed

+1
-35
lines changed

2 files changed

+1
-35
lines changed

src/bootstrap/bin/rustc.rs

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,7 @@ use std::str::FromStr;
2424
use std::time::Instant;
2525

2626
fn main() {
27-
let mut args = env::args_os().skip(1).collect::<Vec<_>>();
28-
29-
// Append metadata suffix for internal crates. See the corresponding entry
30-
// in bootstrap/lib.rs for details.
31-
if let Ok(s) = env::var("RUSTC_METADATA_SUFFIX") {
32-
for i in 1..args.len() {
33-
// Dirty code for borrowing issues
34-
let mut new = None;
35-
if let Some(current_as_str) = args[i].to_str() {
36-
if (&*args[i - 1] == "-C" && current_as_str.starts_with("metadata")) ||
37-
current_as_str.starts_with("-Cmetadata") {
38-
new = Some(format!("{}-{}", current_as_str, s));
39-
}
40-
}
41-
if let Some(new) = new { args[i] = new.into(); }
42-
}
43-
}
27+
let args = env::args_os().skip(1).collect::<Vec<_>>();
4428

4529
// Detect whether or not we're a build script depending on whether --target
4630
// is passed (a bit janky...)

src/bootstrap/builder.rs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -939,24 +939,6 @@ impl<'a> Builder<'a> {
939939

940940
if !mode.is_tool() {
941941
cargo.env("RUSTC_FORCE_UNSTABLE", "1");
942-
943-
// Currently the compiler depends on crates from crates.io, and
944-
// then other crates can depend on the compiler (e.g., proc-macro
945-
// crates). Let's say, for example that rustc itself depends on the
946-
// bitflags crate. If an external crate then depends on the
947-
// bitflags crate as well, we need to make sure they don't
948-
// conflict, even if they pick the same version of bitflags. We'll
949-
// want to make sure that e.g., a plugin and rustc each get their
950-
// own copy of bitflags.
951-
952-
// Cargo ensures that this works in general through the -C metadata
953-
// flag. This flag will frob the symbols in the binary to make sure
954-
// they're different, even though the source code is the exact
955-
// same. To solve this problem for the compiler we extend Cargo's
956-
// already-passed -C metadata flag with our own. Our rustc.rs
957-
// wrapper around the actual rustc will detect -C metadata being
958-
// passed and frob it with this extra string we're passing in.
959-
cargo.env("RUSTC_METADATA_SUFFIX", "rustc");
960942
}
961943

962944
if let Some(x) = self.crt_static(target) {

0 commit comments

Comments
 (0)