Skip to content

Commit

Permalink
Merge pull request #21 from dtolnay/checkcfg
Browse files Browse the repository at this point in the history
Resolve unexpected_cfgs warning
  • Loading branch information
dtolnay authored May 7, 2024
2 parents 7d7cdfd + d2a383b commit ed789ba
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ categories = ["development-tools", "no-std", "no-std::no-alloc"]
description = "Compile-time checks that an enum, struct, or match is written in sorted order."
documentation = "https://docs.rs/remain"
edition = "2021"
exclude = ["build.rs"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/dtolnay/remain"
rust-version = "1.56"
Expand Down
7 changes: 7 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
fn main() {
// Warning: build.rs is not published to crates.io.

println!("cargo:rustc-cfg=check_cfg");
println!("cargo:rustc-check-cfg=cfg(check_cfg)");
println!("cargo:rustc-check-cfg=cfg(remain_stable_testing)");
}
1 change: 1 addition & 0 deletions tests/unstable.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#![allow(dead_code)]
#![cfg(not(remain_stable_testing))]
#![feature(proc_macro_hygiene, stmt_expr_attributes)]
#![cfg_attr(not(check_cfg), allow(unexpected_cfgs))]
#![allow(
clippy::derive_partial_eq_without_eq,
clippy::extra_unused_type_parameters,
Expand Down

0 comments on commit ed789ba

Please sign in to comment.