From 5ad7c245e36062c53c9823569c058430851a3e59 Mon Sep 17 00:00:00 2001 From: Andrew Poelstra Date: Tue, 21 May 2024 17:05:16 +0000 Subject: [PATCH] cargo: whitelist all cfgs used in this repo --- base58/Cargo.toml | 3 +++ bitcoin/Cargo.toml | 3 +++ fuzz/Cargo.toml | 3 +++ hashes/Cargo.toml | 3 +++ internals/Cargo.toml | 3 +++ io/Cargo.toml | 3 +++ units/Cargo.toml | 3 +++ 7 files changed, 21 insertions(+) diff --git a/base58/Cargo.toml b/base58/Cargo.toml index 61fe35a0f..681fb032d 100644 --- a/base58/Cargo.toml +++ b/base58/Cargo.toml @@ -26,3 +26,6 @@ internals = { package = "bitcoin-internals", version = "0.3.0", features = ["all [dev-dependencies] hex = { package = "hex-conservative", version = "0.2.0", default-features = false, features = ["alloc"] } + +[lints.rust] +unexpected_cfgs = { level = "deny", check-cfg = ['cfg(bench)', 'cfg(fuzzing)', 'cfg(kani)' ] } diff --git a/bitcoin/Cargo.toml b/bitcoin/Cargo.toml index 1f02b2870..f839c72c3 100644 --- a/bitcoin/Cargo.toml +++ b/bitcoin/Cargo.toml @@ -79,3 +79,6 @@ required-features = ["std", "rand-std", "bitcoinconsensus"] [[example]] name = "sighash" + +[lints.rust] +unexpected_cfgs = { level = "deny", check-cfg = ['cfg(bench)', 'cfg(fuzzing)', 'cfg(kani)', 'cfg(mutate)', 'cfg(rust_v_1_60)'] } diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml index 3f162df78..f76d61899 100644 --- a/fuzz/Cargo.toml +++ b/fuzz/Cargo.toml @@ -88,3 +88,6 @@ path = "fuzz_targets/hashes/sha512.rs" [[bin]] name = "units_deserialize_amount" path = "fuzz_targets/units/deserialize_amount.rs" + +[lints.rust] +unexpected_cfgs = { level = "deny", check-cfg = ['cfg(fuzzing)'] } diff --git a/hashes/Cargo.toml b/hashes/Cargo.toml index 6538379b1..1368c8eec 100644 --- a/hashes/Cargo.toml +++ b/hashes/Cargo.toml @@ -36,3 +36,6 @@ serde = { version = "1.0", default-features = false, optional = true } [dev-dependencies] serde_test = "1.0" serde_json = "1.0" + +[lints.rust] +unexpected_cfgs = { level = "deny", check-cfg = ['cfg(bench)', 'cfg(hashes_fuzz)', 'cfg(rust_v_1_64)' ] } diff --git a/internals/Cargo.toml b/internals/Cargo.toml index ca6d81be7..9f8f3d5e7 100644 --- a/internals/Cargo.toml +++ b/internals/Cargo.toml @@ -26,3 +26,6 @@ rustdoc-args = ["--cfg", "docsrs"] serde = { version = "1.0.103", default-features = false, optional = true } [dev-dependencies] + +[lints.rust] +unexpected_cfgs = { level = "deny", check-cfg = ['cfg(rust_v_1_64)', 'cfg(rust_v_1_61)'] } diff --git a/io/Cargo.toml b/io/Cargo.toml index ce3a71a48..3369d1f92 100644 --- a/io/Cargo.toml +++ b/io/Cargo.toml @@ -21,3 +21,6 @@ alloc = [] [package.metadata.docs.rs] all-features = true rustdoc-args = ["--cfg", "docsrs"] + +[lints.rust] +unexpected_cfgs = { level = "deny" } diff --git a/units/Cargo.toml b/units/Cargo.toml index 04fffb946..afb1ab1ac 100644 --- a/units/Cargo.toml +++ b/units/Cargo.toml @@ -29,3 +29,6 @@ serde = { version = "1.0.103", default-features = false, features = ["derive"], [dev-dependencies] serde_test = "1.0" serde_json = "1.0" + +[lints.rust] +unexpected_cfgs = { level = "deny", check-cfg = ['cfg(kani)'] }