From 873ad47343f3dba2fd9f7f9b9944a6214e656512 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Tue, 26 Mar 2024 09:32:08 +1100 Subject: [PATCH] Allow dead_code on AlignedType We use the `AlignedType` and take a pointer to its inner data, never access the data directly - this confuses clippy causing a "field is never used" warning. Shoosh the lint and add a code comment explaining why. --- secp256k1-sys/src/types.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/secp256k1-sys/src/types.rs b/secp256k1-sys/src/types.rs index 28ef0fb91..e52b5bfc9 100644 --- a/secp256k1-sys/src/types.rs +++ b/secp256k1-sys/src/types.rs @@ -19,6 +19,7 @@ pub use core::ffi::c_void; // 16 matches is as big as the biggest alignment in any arch that rust currently supports https://github.com/rust-lang/rust/blob/2c31b45ae878b821975c4ebd94cc1e49f6073fd0/library/std/src/sys_common/alloc.rs #[repr(align(16))] #[derive(Default, Copy, Clone)] +#[allow(dead_code)] // We never access the inner data directly, only by way of a pointer. pub struct AlignedType([u8; 16]); impl AlignedType {