Skip to content

Commit

Permalink
Merge pull request #1635 from dtolnay/checkcfg
Browse files Browse the repository at this point in the history
Resolve unexpected_cfgs warning
  • Loading branch information
dtolnay committed May 7, 2024
2 parents 45844d8 + 05c4cd2 commit 884ac0c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions build.rs
Expand Up @@ -14,6 +14,12 @@ fn main() {
// Note: add "/build.rs" to package.include in Cargo.toml if adding any
// conditional compilation within the library.

println!("cargo:rustc-cfg=check_cfg");
println!("cargo:rustc-check-cfg=cfg(check_cfg)");
println!("cargo:rustc-check-cfg=cfg(doc_cfg)");
println!("cargo:rustc-check-cfg=cfg(syn_disable_nightly_tests)");
println!("cargo:rustc-check-cfg=cfg(syn_only)");

if !unstable() {
println!("cargo:rustc-cfg=syn_disable_nightly_tests");
}
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Expand Up @@ -253,6 +253,7 @@
#![cfg_attr(doc_cfg, feature(doc_cfg))]
#![deny(unsafe_op_in_unsafe_fn)]
#![allow(non_camel_case_types)]
#![cfg_attr(not(check_cfg), allow(unexpected_cfgs))]
#![allow(
clippy::bool_to_int_with_if,
clippy::cast_lossless,
Expand Down

0 comments on commit 884ac0c

Please sign in to comment.