From e68da281ff26fea093810a0a277b15adb62e061a Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Fri, 13 Sep 2024 06:43:24 +1000 Subject: [PATCH] Warn on future deprecations We use `TBD` in our `deprecated` string and it was discovered that there is an exception on this string so as not to warn because it is used internally by the Rust language. However there is a special lint to enable warnings, lets use it. Add `#![warn(deprecated_in_future)]` to the coding conventions section of all crates except `fuzz`. --- addresses/src/lib.rs | 1 + base58/src/lib.rs | 1 + bitcoin/src/lib.rs | 1 + hashes/src/lib.rs | 1 + internals/src/lib.rs | 1 + primitives/src/lib.rs | 1 + units/src/lib.rs | 1 + 7 files changed, 7 insertions(+) diff --git a/addresses/src/lib.rs b/addresses/src/lib.rs index 18604ce0a..d71cbfb40 100644 --- a/addresses/src/lib.rs +++ b/addresses/src/lib.rs @@ -16,6 +16,7 @@ #![cfg_attr(docsrs, feature(doc_auto_cfg))] #![doc(test(attr(warn(unused))))] // Coding conventions. +#![warn(deprecated_in_future)] #![warn(missing_docs)] // Exclude lints we don't think are valuable. #![allow(clippy::needless_question_mark)] // https://github.com/rust-bitcoin/rust-bitcoin/pull/2134 diff --git a/base58/src/lib.rs b/base58/src/lib.rs index f819d8d97..2ff1a45de 100644 --- a/base58/src/lib.rs +++ b/base58/src/lib.rs @@ -12,6 +12,7 @@ #![cfg_attr(bench, feature(test))] // Coding conventions. #![warn(missing_docs)] +#![warn(deprecated_in_future)] #![doc(test(attr(warn(unused))))] // Instead of littering the codebase for non-fuzzing and bench code just globally allow. #![cfg_attr(fuzzing, allow(dead_code, unused_imports))] diff --git a/bitcoin/src/lib.rs b/bitcoin/src/lib.rs index a030bf3ea..6b358dcb9 100644 --- a/bitcoin/src/lib.rs +++ b/bitcoin/src/lib.rs @@ -30,6 +30,7 @@ #![cfg_attr(bench, feature(test))] // Coding conventions. #![warn(missing_docs)] +#![warn(deprecated_in_future)] #![doc(test(attr(warn(unused))))] // Instead of littering the codebase for non-fuzzing and bench code just globally allow. #![cfg_attr(fuzzing, allow(dead_code, unused_imports))] diff --git a/hashes/src/lib.rs b/hashes/src/lib.rs index 49fb05f47..c42f38cd2 100644 --- a/hashes/src/lib.rs +++ b/hashes/src/lib.rs @@ -56,6 +56,7 @@ #![cfg_attr(bench, feature(test))] // Coding conventions. #![warn(missing_docs)] +#![warn(deprecated_in_future)] #![doc(test(attr(warn(unused))))] // Instead of littering the codebase for non-fuzzing and bench code just globally allow. #![cfg_attr(hashes_fuzz, allow(dead_code, unused_imports))] diff --git a/internals/src/lib.rs b/internals/src/lib.rs index ff78d9581..d65af990e 100644 --- a/internals/src/lib.rs +++ b/internals/src/lib.rs @@ -10,6 +10,7 @@ #![cfg_attr(docsrs, feature(doc_auto_cfg))] // Coding conventions. #![warn(missing_docs)] +#![warn(deprecated_in_future)] #![doc(test(attr(warn(unused))))] // Exclude lints we don't think are valuable. #![allow(clippy::needless_question_mark)] // https://github.com/rust-bitcoin/rust-bitcoin/pull/2134 diff --git a/primitives/src/lib.rs b/primitives/src/lib.rs index f49aa2ffe..4ba3ef7ff 100644 --- a/primitives/src/lib.rs +++ b/primitives/src/lib.rs @@ -13,6 +13,7 @@ #![cfg_attr(docsrs, feature(doc_auto_cfg))] // Coding conventions. #![warn(missing_docs)] +#![warn(deprecated_in_future)] #![doc(test(attr(warn(unused))))] // Exclude lints we don't think are valuable. #![allow(clippy::needless_question_mark)] // https://github.com/rust-bitcoin/rust-bitcoin/pull/2134 diff --git a/units/src/lib.rs b/units/src/lib.rs index af2890b01..58f97694e 100644 --- a/units/src/lib.rs +++ b/units/src/lib.rs @@ -8,6 +8,7 @@ #![cfg_attr(docsrs, feature(doc_auto_cfg))] // Coding conventions. #![warn(missing_docs)] +#![warn(deprecated_in_future)] #![doc(test(attr(warn(unused))))] // Exclude lints we don't think are valuable. #![allow(clippy::needless_question_mark)] // https://github.com/rust-bitcoin/rust-bitcoin/pull/2134