diff --git a/Cargo.toml b/Cargo.toml index 1b3afaa..a0693c1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" diff --git a/build.rs b/build.rs new file mode 100644 index 0000000..113f8a0 --- /dev/null +++ b/build.rs @@ -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)"); +} diff --git a/tests/unstable.rs b/tests/unstable.rs index dd9fa80..b306de9 100644 --- a/tests/unstable.rs +++ b/tests/unstable.rs @@ -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,