Skip to content

Commit

Permalink
Rollup merge of rust-lang#77829 - gburgessiv:unused-features-var, r=a…
Browse files Browse the repository at this point in the history
…lexcrichton

bootstrap: only use compiler-builtins-c if they exist

The assignment of `features` above was added in rust-lang#60981, but
never used. Presumably the intent was to replace the string literal here
with it.

While I'm in the area, `compiler_builtins_c_feature` doesn't need to be
a `String`.

I'm not entirely sure of a great way to locally test this -- `./x.py test`
passed on my machine, but 🤷‍♂️.

r? @alexcrichton
  • Loading branch information
Dylan-DPC committed Oct 14, 2020
2 parents 41146c1 + ca5478a commit 31799ba
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/bootstrap/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,25 +234,25 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car
// Note that `libprofiler_builtins/build.rs` also computes this so if
// you're changing something here please also change that.
cargo.env("RUST_COMPILER_RT_ROOT", &compiler_builtins_root);
" compiler-builtins-c".to_string()
" compiler-builtins-c"
} else {
String::new()
""
};

if builder.no_std(target) == Some(true) {
let mut features = "compiler-builtins-mem".to_string();
features.push_str(&compiler_builtins_c_feature);
features.push_str(compiler_builtins_c_feature);

// for no-std targets we only compile a few no_std crates
cargo
.args(&["-p", "alloc"])
.arg("--manifest-path")
.arg(builder.src.join("library/alloc/Cargo.toml"))
.arg("--features")
.arg("compiler-builtins-mem compiler-builtins-c");
.arg(features);
} else {
let mut features = builder.std_features();
features.push_str(&compiler_builtins_c_feature);
features.push_str(compiler_builtins_c_feature);

cargo
.arg("--features")
Expand Down

0 comments on commit 31799ba

Please sign in to comment.