From 6cdbb04820fcd78642a81854080369b5fbee598f Mon Sep 17 00:00:00 2001 From: Andrew Poelstra Date: Tue, 19 Dec 2023 16:38:53 +0000 Subject: [PATCH] clippy: whitelist uninhabited_references lint This lint triggers on `fn input_len(&self) -> usize { match *self {} }` where Self is an infallible type, claiming that the dereference of self is UB. Maybe it would be, if this were possible. But it's not, and this is literally the only point of using infallible types, so this lint is always wrong. Enabled in rustc 1.76 as warn by default. --- bitcoin/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/bitcoin/src/lib.rs b/bitcoin/src/lib.rs index 0ebbe5a2..51474e2a 100644 --- a/bitcoin/src/lib.rs +++ b/bitcoin/src/lib.rs @@ -38,6 +38,7 @@ #![cfg_attr(fuzzing, allow(dead_code, unused_imports))] // Exclude clippy lints we don't think are valuable #![allow(clippy::needless_question_mark)] // https://github.com/rust-bitcoin/rust-bitcoin/pull/2134 +#![allow(clippy::uninhabited_references)] // falsely claims that 100% safe code is UB // Disable 16-bit support at least for now as we can't guarantee it yet. #[cfg(target_pointer_width = "16")]