Skip to content

Commit 31799ba

Browse files
authored
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 #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
2 parents 41146c1 + ca5478a commit 31799ba

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/bootstrap/compile.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -234,25 +234,25 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car
234234
// Note that `libprofiler_builtins/build.rs` also computes this so if
235235
// you're changing something here please also change that.
236236
cargo.env("RUST_COMPILER_RT_ROOT", &compiler_builtins_root);
237-
" compiler-builtins-c".to_string()
237+
" compiler-builtins-c"
238238
} else {
239-
String::new()
239+
""
240240
};
241241

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

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

257257
cargo
258258
.arg("--features")

0 commit comments

Comments
 (0)