diff --git a/libafl_bolts/src/core_affinity.rs b/libafl_bolts/src/core_affinity.rs index d06ee30855..4099b54809 100644 --- a/libafl_bolts/src/core_affinity.rs +++ b/libafl_bolts/src/core_affinity.rs @@ -459,7 +459,6 @@ mod windows { } } - #[expect(trivial_numeric_casts)] #[expect(clippy::cast_ptr_alignment)] #[expect(clippy::cast_possible_wrap)] pub fn get_num_logical_cpus_ex_windows() -> Option { @@ -469,8 +468,7 @@ mod windows { const RelationProcessorCore: u32 = 0; #[repr(C)] - #[expect(non_camel_case_types)] - #[expect(dead_code)] + #[allow(non_camel_case_types)] // expect breaks for some reason struct GROUP_AFFINITY { mask: usize, group: u16, @@ -478,8 +476,8 @@ mod windows { } #[repr(C)] - #[expect(non_camel_case_types)] - #[expect(dead_code)] + #[allow(non_camel_case_types)] // expect breaks for some reason + struct PROCESSOR_RELATIONSHIP { flags: u8, efficiency_class: u8, @@ -489,8 +487,7 @@ mod windows { } #[repr(C)] - #[expect(non_camel_case_types)] - #[expect(dead_code)] + #[allow(non_camel_case_types)] // expect breaks for some reason struct SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX { relationship: u32, size: u32, @@ -625,7 +622,6 @@ mod apple { ) -> kern_return_t; } - #[expect(clippy::unnecessary_wraps)] pub fn get_core_ids() -> Result, Error> { Ok((0..(usize::from(available_parallelism()?))) .map(CoreId) diff --git a/libafl_bolts/src/lib.rs b/libafl_bolts/src/lib.rs index 4abbbf64c0..258051bad4 100644 --- a/libafl_bolts/src/lib.rs +++ b/libafl_bolts/src/lib.rs @@ -608,24 +608,28 @@ impl From for Error { } impl From for Error { + #[allow(unused_variables)] // err is used without std fn from(err: ParseIntError) -> Self { Self::unknown(format!("Failed to parse Int: {err:?}")) } } impl From for Error { + #[allow(unused_variables)] // err is used without std fn from(err: TryFromIntError) -> Self { Self::illegal_state(format!("Expected conversion failed: {err:?}")) } } impl From for Error { + #[allow(unused_variables)] // err is used without std fn from(err: TryFromSliceError) -> Self { Self::illegal_argument(format!("Could not convert slice: {err:?}")) } } impl From for Error { + #[allow(unused_variables)] // err is used without std fn from(err: SetLoggerError) -> Self { Self::illegal_state(format!("Failed to register logger: {err:?}")) } diff --git a/libafl_bolts/src/minibsod.rs b/libafl_bolts/src/minibsod.rs index 9925ef556d..cc2807e81e 100644 --- a/libafl_bolts/src/minibsod.rs +++ b/libafl_bolts/src/minibsod.rs @@ -64,7 +64,6 @@ pub fn dump_registers( /// Write the content of all important registers #[cfg(all(any(target_os = "linux", target_os = "android"), target_arch = "x86"))] -#[expect(clippy::similar_names)] pub fn dump_registers( writer: &mut BufWriter, ucontext: &ucontext_t, @@ -143,7 +142,6 @@ pub fn dump_registers( /// Write the content of all important registers #[cfg(all(target_os = "freebsd", target_arch = "aarch64"))] -#[expect(clippy::similar_names)] pub fn dump_registers( writer: &mut BufWriter, ucontext: &ucontext_t, @@ -167,7 +165,6 @@ pub fn dump_registers( /// Write the content of all important registers #[cfg(all(target_vendor = "apple", target_arch = "aarch64"))] -#[expect(clippy::similar_names)] pub fn dump_registers( writer: &mut BufWriter, ucontext: &ucontext_t, @@ -227,7 +224,6 @@ pub fn dump_registers( any(target_os = "freebsd", target_os = "dragonfly"), target_arch = "x86_64" ))] -#[expect(clippy::similar_names)] pub fn dump_registers( writer: &mut BufWriter, ucontext: &ucontext_t, @@ -257,7 +253,6 @@ pub fn dump_registers( /// Write the content of all important registers #[cfg(all(target_os = "netbsd", target_arch = "x86_64"))] -#[expect(clippy::similar_names)] pub fn dump_registers( writer: &mut BufWriter, ucontext: &ucontext_t, @@ -367,7 +362,6 @@ pub fn dump_registers( /// Write the content of all important registers #[cfg(all(target_os = "openbsd", target_arch = "x86_64"))] -#[expect(clippy::similar_names)] pub fn dump_registers( writer: &mut BufWriter, ucontext: &ucontext_t, @@ -395,7 +389,6 @@ pub fn dump_registers( /// Write the content of all important registers #[cfg(all(target_os = "openbsd", target_arch = "aarch64"))] -#[expect(clippy::similar_names)] pub fn dump_registers( writer: &mut BufWriter, ucontext: &ucontext_t, @@ -418,7 +411,6 @@ pub fn dump_registers( any(target_os = "solaris", target_os = "illumos"), target_arch = "x86_64" ))] -#[expect(clippy::similar_names)] pub fn dump_registers( writer: &mut BufWriter, ucontext: &ucontext_t, @@ -454,7 +446,6 @@ pub fn dump_registers( /// Write the content of all important registers #[cfg(all(target_os = "windows", target_arch = "x86_64"))] -#[expect(clippy::similar_names)] pub fn dump_registers( writer: &mut BufWriter, context: &CONTEXT, @@ -483,7 +474,6 @@ pub fn dump_registers( /// Write the content of all important registers #[cfg(all(target_os = "windows", target_arch = "x86"))] -#[expect(clippy::similar_names)] pub fn dump_registers( writer: &mut BufWriter, context: &CONTEXT, @@ -503,7 +493,6 @@ pub fn dump_registers( /// Write the content of all important registers #[cfg(all(target_os = "windows", target_arch = "aarch64"))] -#[expect(clippy::similar_names)] pub fn dump_registers( writer: &mut BufWriter, context: &CONTEXT, @@ -530,7 +519,6 @@ pub fn dump_registers( /// Write the content of all important registers #[cfg(all(target_os = "haiku", target_arch = "x86_64"))] -#[expect(clippy::similar_names)] pub fn dump_registers( writer: &mut BufWriter, ucontext: &ucontext_t, @@ -669,7 +657,6 @@ fn write_crash( } #[cfg(all(target_vendor = "apple", target_arch = "aarch64"))] -#[expect(clippy::similar_names)] fn write_crash( writer: &mut BufWriter, signal: Signal, @@ -686,7 +673,6 @@ fn write_crash( } #[cfg(all(target_vendor = "apple", target_arch = "x86_64"))] -#[expect(clippy::similar_names)] fn write_crash( writer: &mut BufWriter, signal: Signal, @@ -708,7 +694,6 @@ fn write_crash( } #[cfg(all(target_os = "freebsd", target_arch = "x86_64"))] -#[expect(clippy::similar_names)] fn write_crash( writer: &mut BufWriter, signal: Signal, @@ -724,7 +709,6 @@ fn write_crash( } #[cfg(all(target_os = "dragonfly", target_arch = "x86_64"))] -#[expect(clippy::similar_names)] fn write_crash( writer: &mut BufWriter, signal: Signal, @@ -740,7 +724,6 @@ fn write_crash( } #[cfg(all(target_os = "openbsd", target_arch = "x86_64"))] -#[expect(clippy::similar_names)] fn write_crash( writer: &mut BufWriter, signal: Signal, @@ -756,7 +739,6 @@ fn write_crash( } #[cfg(all(target_os = "openbsd", target_arch = "aarch64"))] -#[expect(clippy::similar_names)] fn write_crash( writer: &mut BufWriter, signal: Signal, @@ -1002,7 +984,6 @@ fn write_minibsod(writer: &mut BufWriter) -> Result<(), std::io::Er } #[cfg(target_vendor = "apple")] -#[expect(non_camel_case_types)] fn write_minibsod(writer: &mut BufWriter) -> Result<(), std::io::Error> { let mut ptask = std::mem::MaybeUninit::::uninit(); // We start by the lowest virtual address from the userland' standpoint diff --git a/libafl_bolts/src/os/unix_signals.rs b/libafl_bolts/src/os/unix_signals.rs index ca27bc1994..e06be190f4 100644 --- a/libafl_bolts/src/os/unix_signals.rs +++ b/libafl_bolts/src/os/unix_signals.rs @@ -107,6 +107,7 @@ pub struct ucontext_t { #[derive(Debug)] #[repr(C)] #[expect(clippy::pub_underscore_fields)] +#[allow(non_camel_case_types)] // expect breaks for some reason pub struct arm_exception_state64 { /// Virtual Fault Address pub __far: u64, @@ -132,6 +133,7 @@ pub struct arm_exception_state64 { #[derive(Debug)] #[repr(C)] #[expect(clippy::pub_underscore_fields)] +#[allow(non_camel_case_types)] // expect breaks for some reason pub struct arm_thread_state64 { /// General purpose registers x0-x28 pub __x: [u64; 29], @@ -157,9 +159,9 @@ pub struct arm_thread_state64 { /// ```` #[cfg(all(target_vendor = "apple", target_arch = "aarch64"))] #[derive(Debug)] -#[expect(non_camel_case_types)] #[repr(C, align(16))] -//#[repr(align(16))] +#[allow(non_camel_case_types)] // expect breaks for some reason + //#[repr(align(16))] pub struct arm_neon_state64 { /// opaque pub opaque: [u8; (32 * 16) + (2 * size_of::())], @@ -174,10 +176,10 @@ pub struct arm_neon_state64 { ///}; /// ``` #[cfg(all(target_vendor = "apple", target_arch = "aarch64"))] -#[expect(non_camel_case_types)] #[derive(Debug)] #[repr(C)] #[expect(clippy::pub_underscore_fields)] +#[allow(non_camel_case_types)] // expect breaks for some reason pub struct mcontext64 { /// `_STRUCT_ARM_EXCEPTION_STATE64` pub __es: arm_exception_state64, @@ -197,8 +199,8 @@ pub struct mcontext64 { /// ``` #[cfg(all(target_vendor = "apple", target_arch = "aarch64"))] #[derive(Debug)] -#[expect(non_camel_case_types)] #[repr(C)] +#[allow(non_camel_case_types)] // expect breaks for some reason pub struct sigaltstack { /// signal stack base pub ss_sp: *mut c_void, @@ -226,8 +228,8 @@ pub struct sigaltstack { /// ``` #[cfg(all(target_vendor = "apple", target_arch = "aarch64"))] #[derive(Debug)] -#[expect(non_camel_case_types)] #[repr(C)] +#[allow(non_camel_case_types)] // expect breaks for some reason pub struct ucontext_t { /// onstack pub uc_onstack: c_int, diff --git a/libafl_bolts/src/shmem.rs b/libafl_bolts/src/shmem.rs index ed268a4d0e..ae6a9436e6 100644 --- a/libafl_bolts/src/shmem.rs +++ b/libafl_bolts/src/shmem.rs @@ -771,6 +771,7 @@ pub mod unix_shmem { } } + #[expect(clippy::unnecessary_wraps)] fn shmem_from_id_and_size(id: ShMemId, map_size: usize) -> Result { // # Safety // No user-provided potentially unsafe parameters.