Skip to content

Commit 37c5d18

Browse files
authored
Merge pull request #456 from dtolnay/checkcfg
Resolve unexpected_cfgs warning
2 parents fd2c998 + 5e02f52 commit 37c5d18

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

build.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434
// macro API and catching a panic if it isn't available. Enabled on Rust
3535
// 1.57+.
3636

37+
#![allow(unknown_lints)]
38+
#![allow(unexpected_cfgs)]
39+
3740
use std::env;
3841
use std::ffi::OsString;
3942
use std::iter;
@@ -44,6 +47,23 @@ use std::str;
4447
fn main() {
4548
let rustc = rustc_minor_version().unwrap_or(u32::MAX);
4649

50+
if rustc >= 80 {
51+
println!("cargo:rustc-check-cfg=cfg(doc_cfg)");
52+
println!("cargo:rustc-check-cfg=cfg(fuzzing)");
53+
println!("cargo:rustc-check-cfg=cfg(nightly)");
54+
println!("cargo:rustc-check-cfg=cfg(no_is_available)");
55+
println!("cargo:rustc-check-cfg=cfg(no_literal_byte_character)");
56+
println!("cargo:rustc-check-cfg=cfg(no_literal_c_string)");
57+
println!("cargo:rustc-check-cfg=cfg(no_source_text)");
58+
println!("cargo:rustc-check-cfg=cfg(proc_macro_span)");
59+
println!("cargo:rustc-check-cfg=cfg(procmacro2_backtrace)");
60+
println!("cargo:rustc-check-cfg=cfg(procmacro2_nightly_testing)");
61+
println!("cargo:rustc-check-cfg=cfg(procmacro2_semver_exempt)");
62+
println!("cargo:rustc-check-cfg=cfg(span_locations)");
63+
println!("cargo:rustc-check-cfg=cfg(super_unstable)");
64+
println!("cargo:rustc-check-cfg=cfg(wrap_proc_macro)");
65+
}
66+
4767
let docs_rs = env::var_os("DOCS_RS").is_some();
4868
let semver_exempt = cfg!(procmacro2_semver_exempt) || docs_rs;
4969
if semver_exempt {

0 commit comments

Comments
 (0)