Skip to content

Commit

Permalink
Resolve unexpected_cfgs warning when build script is not run
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Oct 18, 2024
1 parent fba7a15 commit 6fe6435
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@ fn main() {
// Warning: build.rs is not published to crates.io.

println!("cargo:rerun-if-changed=src/tests");
println!("cargo:rustc-cfg=check_cfg");
println!("cargo:rustc-check-cfg=cfg(check_cfg)");
println!("cargo:rustc-check-cfg=cfg(trybuild_no_target)");
}
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@
//! ```

#![doc(html_root_url = "https://docs.rs/trybuild/1.0.100")]
#![cfg_attr(not(check_cfg), allow(unexpected_cfgs))]
#![allow(
clippy::collapsible_if,
clippy::comparison_chain,
Expand Down

0 comments on commit 6fe6435

Please sign in to comment.