From eeff7ab3f7f1fc68e6a3926ed5e4d572361d9f7a Mon Sep 17 00:00:00 2001 From: pupu Date: Fri, 19 Jul 2024 11:28:24 +0800 Subject: [PATCH] Adjust check-cfg for Rust 1.76 compatibility This commit moves the lint config for check-cfg from build.rs to Cargo.toml. This change ensures compatibility with Rust versions <=1.76 while silencing cfg warnings in newer versions. Further refrence: https://blog.rust-lang.org/2024/05/06/check-cfg.html#expecting-custom-cfgs --- Cargo.toml | 3 +++ build.rs | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) delete mode 100644 build.rs diff --git a/Cargo.toml b/Cargo.toml index 9d975d8..f9bf4ab 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,3 +29,6 @@ std = [] # Enable the implementation of the map Key trait for ArrayVec and ArrayString arrayvec = ["dep:arrayvec"] _test = ["dep:futures", "dep:approx", "std", "arrayvec"] + +[lints.rust] +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(fuzzing_repro)'] } diff --git a/build.rs b/build.rs deleted file mode 100644 index f5e0358..0000000 --- a/build.rs +++ /dev/null @@ -1,3 +0,0 @@ -fn main() { - println!("cargo::rustc-check-cfg=cfg(fuzzing_repro)"); -}