Skip to content

Commit 07bb6bf

Browse files
committed
Use new check-cfg syntax in newer nightly
rust-lang/rust#82450 (comment)
1 parent 0644a87 commit 07bb6bf

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

build.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,19 @@ fn main() {
167167
// https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg
168168
if libc_check_cfg {
169169
for cfg in ALLOWED_CFGS {
170-
println!("cargo:rustc-check-cfg=values({})", cfg);
170+
if rustc_minor_ver >= 75 {
171+
println!("cargo:rustc-check-cfg=cfg({})", cfg);
172+
} else {
173+
println!("cargo:rustc-check-cfg=values({})", cfg);
174+
}
171175
}
172176
for &(name, values) in CHECK_CFG_EXTRA {
173177
let values = values.join("\",\"");
174-
println!("cargo:rustc-check-cfg=values({},\"{}\")", name, values);
178+
if rustc_minor_ver >= 75 {
179+
println!("cargo:rustc-check-cfg=cfg({},values(\"{}\"))", name, values);
180+
} else {
181+
println!("cargo:rustc-check-cfg=values({},\"{}\")", name, values);
182+
}
175183
}
176184
}
177185
}

0 commit comments

Comments
 (0)