Skip to content

Commit

Permalink
Sync with rustix' build.rs changes (#58)
Browse files Browse the repository at this point in the history
io-lifetimes and rustix and a few other crates I maintain have similar
build.rs scripts. Port some of the changes from rustix here to keep
them in sync.
  • Loading branch information
sunfishcode committed Mar 29, 2024
1 parent 72fdc30 commit 64d654a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ fn use_feature(feature: &str) {

/// Test whether the rustc at `var("RUSTC")` supports the given feature.
fn has_feature(feature: &str) -> bool {
can_compile(&format!(
can_compile(format!(
"#![allow(stable_features)]\n#![feature({})]",
feature
))
Expand All @@ -48,8 +48,8 @@ fn can_compile<T: AsRef<str>>(test: T) -> bool {
let rustc = var("RUSTC").unwrap();
let target = var("TARGET").unwrap();

// Use `RUSTC_WRAPPER` if it's set, unless it's set to an empty string,
// as documented [here].
// Use `RUSTC_WRAPPER` if it's set, unless it's set to an empty string, as
// documented [here].
// [here]: https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-reads
let wrapper = var("RUSTC_WRAPPER")
.ok()
Expand Down

0 comments on commit 64d654a

Please sign in to comment.