From 3d01146374ea2fd31c147da64871cedbc0c02051 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Wed, 20 Mar 2024 10:53:35 +1100 Subject: [PATCH] Allow needless-borrows-for-generic-args This lint triggers when parsing a reference to a large struct as a generic argument, which is wrong. Allow it crate wide because [subjectively] this lint never warns for anything useful. --- bitcoin/src/lib.rs | 1 + hashes/src/lib.rs | 1 + internals/src/lib.rs | 1 + io/src/lib.rs | 1 + units/src/lib.rs | 1 + 5 files changed, 5 insertions(+) diff --git a/bitcoin/src/lib.rs b/bitcoin/src/lib.rs index c86ed6a3..d264e37d 100644 --- a/bitcoin/src/lib.rs +++ b/bitcoin/src/lib.rs @@ -39,6 +39,7 @@ // Exclude lints we don't think are valuable. #![allow(clippy::needless_question_mark)] // https://github.com/rust-bitcoin/rust-bitcoin/pull/2134 #![allow(clippy::manual_range_contains)] // More readable than clippy's format. +#![allow(clippy::needless_borrows_for_generic_args)] // https://github.com/rust-lang/rust-clippy/issues/12454 // Disable 16-bit support at least for now as we can't guarantee it yet. #[cfg(target_pointer_width = "16")] diff --git a/hashes/src/lib.rs b/hashes/src/lib.rs index e45fe9b2..9a83afa0 100644 --- a/hashes/src/lib.rs +++ b/hashes/src/lib.rs @@ -76,6 +76,7 @@ // Exclude lints we don't think are valuable. #![allow(clippy::needless_question_mark)] // https://github.com/rust-bitcoin/rust-bitcoin/pull/2134 #![allow(clippy::manual_range_contains)] // More readable than clippy's format. +#![allow(clippy::needless_borrows_for_generic_args)] // https://github.com/rust-lang/rust-clippy/issues/12454 #[cfg(all(feature = "alloc", not(feature = "std")))] extern crate alloc; diff --git a/internals/src/lib.rs b/internals/src/lib.rs index ef31a0e7..bcbd3f26 100644 --- a/internals/src/lib.rs +++ b/internals/src/lib.rs @@ -14,6 +14,7 @@ // Exclude lints we don't think are valuable. #![allow(clippy::needless_question_mark)] // https://github.com/rust-bitcoin/rust-bitcoin/pull/2134 #![allow(clippy::manual_range_contains)] // More readable than clippy's format. +#![allow(clippy::needless_borrows_for_generic_args)] // https://github.com/rust-lang/rust-clippy/issues/12454 #[cfg(feature = "alloc")] extern crate alloc; diff --git a/io/src/lib.rs b/io/src/lib.rs index 373e7a05..93143f14 100644 --- a/io/src/lib.rs +++ b/io/src/lib.rs @@ -16,6 +16,7 @@ // Exclude lints we don't think are valuable. #![allow(clippy::needless_question_mark)] // https://github.com/rust-bitcoin/rust-bitcoin/pull/2134 #![allow(clippy::manual_range_contains)] // More readable than clippy's format. +#![allow(clippy::needless_borrows_for_generic_args)] // https://github.com/rust-lang/rust-clippy/issues/12454 #[cfg(feature = "alloc")] extern crate alloc; diff --git a/units/src/lib.rs b/units/src/lib.rs index f52176b2..0da62a64 100644 --- a/units/src/lib.rs +++ b/units/src/lib.rs @@ -11,6 +11,7 @@ // Exclude lints we don't think are valuable. #![allow(clippy::needless_question_mark)] // https://github.com/rust-bitcoin/rust-bitcoin/pull/2134 #![allow(clippy::manual_range_contains)] // More readable than clippy's format. +#![allow(clippy::needless_borrows_for_generic_args)] // https://github.com/rust-lang/rust-clippy/issues/12454 #![no_std] // Disable 16-bit support at least for now as we can't guarantee it yet.