diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs index 8ab64bcad54..05b66f94727 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs @@ -1512,10 +1512,7 @@ impl<'a> Builder<'a> { Mode::Codegen => metadata.push_str("codegen"), _ => {} } - - if mode != Mode::Std { - cargo.env("__CARGO_DEFAULT_LIB_METADATA", &metadata); - } + cargo.env("__CARGO_DEFAULT_LIB_METADATA", &metadata); if cmd == "clippy" { rustflags.arg("-Zforce-unstable-if-unmarked"); diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs index c51a848bb70..14c3ef79a78 100644 --- a/src/bootstrap/compile.rs +++ b/src/bootstrap/compile.rs @@ -1798,7 +1798,7 @@ pub fn run_cargo( meta.len() == expected_len && filename .strip_prefix(&prefix[..]) - .map(|s| s.ends_with(&extension[..])) + .map(|s| s.starts_with('-') && s.ends_with(&extension[..])) .unwrap_or(false) }); let max = candidates.max_by_key(|&&(_, _, ref metadata)| {