about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2020-10-14 02:30:44 +0200
committerGitHub <noreply@github.com>2020-10-14 02:30:44 +0200
commit31799bade5116eaba9da6acbbbbfd5bd2fe04275 (patch)
tree48e9555753605c8906e50b3c69eb7fe414ac47a9 /src
parent41146c142041d631c24bf77d8ae00e73aebea9d4 (diff)
parentca5478a5dffd322c9b371b44af9b4ea963a0ee47 (diff)
downloadrust-31799bade5116eaba9da6acbbbbfd5bd2fe04275.tar.gz
rust-31799bade5116eaba9da6acbbbbfd5bd2fe04275.zip
Rollup merge of #77829 - gburgessiv:unused-features-var, r=alexcrichton
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
Diffstat (limited to 'src')
-rw-r--r--src/bootstrap/compile.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs
index 40bf6c48296..5215ab3dd4f 100644
--- a/src/bootstrap/compile.rs
+++ b/src/bootstrap/compile.rs
@@ -234,14 +234,14 @@ 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
@@ -249,10 +249,10 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car
             .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")