Skip to content

Commit fd3d4c6

Browse files
authored
Merge pull request #87 from dtolnay/checkcfg
Resolve unexpected_cfgs warning
2 parents 6f47988 + d64f3ff commit fd3d4c6

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

impl/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ authors = ["David Tolnay <[email protected]>"]
55
description = "Implementation detail of the linkme crate"
66
documentation = "https://docs.rs/linkme"
77
edition = "2021"
8+
exclude = ["build.rs"]
89
license = "MIT OR Apache-2.0"
910
repository = "https://github.com/dtolnay/linkme"
1011
rust-version = "1.62"

impl/build.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
fn main() {
2+
// Warning: build.rs is not published to crates.io.
3+
4+
println!("cargo:rustc-cfg=check_cfg");
5+
println!("cargo:rustc-check-cfg=cfg(check_cfg)");
6+
println!("cargo:rustc-check-cfg=cfg(exhaustive)");
7+
}

impl/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![cfg_attr(all(test, exhaustive), feature(non_exhaustive_omitted_patterns_lint))]
2+
#![cfg_attr(not(check_cfg), allow(unexpected_cfgs))]
23
#![allow(
34
clippy::cast_possible_truncation, // https://github.com/rust-lang/rust-clippy/issues/7486
45
clippy::needless_pass_by_value,

0 commit comments

Comments
 (0)