Skip to content

Commit

Permalink
Merge rust-bitcoin#689: Allow dead_code on AlignedType
Browse files Browse the repository at this point in the history
873ad47 Allow dead_code on AlignedType (Tobin C. Harding)

Pull request description:

  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.

ACKs for top commit:
  apoelstra:
    ACK 873ad47

Tree-SHA512: 2a383aed169edf247def5c291bc2d8177cc09412b82bb47bb514e0929ae89d689102e646dcbbffc6fd4caa1ce1430420a63c7ceb3428ad9b05230a93b7f14d16
  • Loading branch information
apoelstra committed Mar 26, 2024
2 parents fb676dc + 873ad47 commit 5fa3623
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions secp256k1-sys/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 5fa3623

Please sign in to comment.