Skip to content

Commit 3bcdea7

Browse files
Urgausnogge
authored andcommitted
Use new check-cfg syntax in newer nightly
rust-lang/rust#82450 (comment)
1 parent 17fe437 commit 3bcdea7

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
@@ -173,11 +173,19 @@ fn main() {
173173
// https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg
174174
if libc_check_cfg {
175175
for cfg in ALLOWED_CFGS {
176-
println!("cargo:rustc-check-cfg=values({})", cfg);
176+
if rustc_minor_ver >= 75 {
177+
println!("cargo:rustc-check-cfg=cfg({})", cfg);
178+
} else {
179+
println!("cargo:rustc-check-cfg=values({})", cfg);
180+
}
177181
}
178182
for &(name, values) in CHECK_CFG_EXTRA {
179183
let values = values.join("\",\"");
180-
println!("cargo:rustc-check-cfg=values({},\"{}\")", name, values);
184+
if rustc_minor_ver >= 75 {
185+
println!("cargo:rustc-check-cfg=cfg({},values(\"{}\"))", name, values);
186+
} else {
187+
println!("cargo:rustc-check-cfg=values({},\"{}\")", name, values);
188+
}
181189
}
182190
}
183191
}

0 commit comments

Comments
 (0)