Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow dead_code on AlignedType #689

Merged
merged 1 commit into from
Mar 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
tcharding committed Mar 25, 2024
commit 873ad47343f3dba2fd9f7f9b9944a6214e656512
1 change: 1 addition & 0 deletions secp256k1-sys/src/types.rs
Original file line number Diff line number Diff line change
@@ -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 {

Unchanged files with check annotations Beta

# This file is automatically @generated by Cargo.

Check warning on line 1 in Cargo-recent.lock

GitHub Actions / Test - beta toolchain

Dependencies could be updated

Check warning on line 1 in Cargo-recent.lock

GitHub Actions / Test - nightly toolchain

Dependencies could be updated

Check warning on line 1 in Cargo-recent.lock

GitHub Actions / Test - stable toolchain

Dependencies could be updated

Check warning on line 1 in Cargo-recent.lock

GitHub Actions / Test - 1.48.0 toolchain

Dependencies could be updated
# It is not intended for manual editing.
version = 3