Skip to content

Allow new unpredictable_function_pointer_comparisons lints #4489

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

Merged
merged 1 commit into from
Jun 15, 2025
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions src/fuchsia/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,8 @@ s! {
__dummy4: [c_char; 16],
}

// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct sigaction {
pub sa_sigaction: crate::sighandler_t,
pub sa_mask: crate::sigset_t,
Expand Down
2 changes: 2 additions & 0 deletions src/unix/bsd/freebsdlike/dragonfly/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,8 @@ s_no_extra_traits! {
pub mc_fpregs: [c_uint; 256],
}

// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct ucontext_t {
pub uc_sigmask: crate::sigset_t,
pub uc_mcontext: mcontext_t,
Expand Down
2 changes: 2 additions & 0 deletions src/unix/bsd/freebsdlike/freebsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,8 @@ impl Clone for devstat_select_mode {
}

s! {
// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct __c_anonymous_sigev_thread {
pub _function: Option<extern "C" fn(crate::sigval) -> *mut c_void>,
//pub _function: *mut c_void, // Actually a function pointer
Expand Down
2 changes: 2 additions & 0 deletions src/unix/cygwin/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,8 @@ s! {
pub cr2: u64,
}

// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct sigevent {
pub sigev_value: sigval,
pub sigev_signo: c_int,
Expand Down
3 changes: 3 additions & 0 deletions src/unix/haiku/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -403,11 +403,14 @@ s! {
}

// kernel/image.h
// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct image_info {
pub id: image_id,
pub image_type: c_int,
pub sequence: i32,
pub init_order: i32,
// FIXME(1.0): these should be made optional
pub init_routine: extern "C" fn(),
pub term_routine: extern "C" fn(),
pub device: crate::dev_t,
Expand Down
2 changes: 2 additions & 0 deletions src/unix/linux_like/android/b32/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ pub type __u64 = c_ulonglong;
pub type __s64 = c_longlong;

s! {
// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct sigaction {
pub sa_sigaction: crate::sighandler_t,
pub sa_mask: crate::sigset_t,
Expand Down
2 changes: 2 additions & 0 deletions src/unix/linux_like/android/b64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ s! {
__val: [c_ulong; 1],
}

// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct sigaction {
pub sa_flags: c_int,
pub sa_sigaction: crate::sighandler_t,
Expand Down
2 changes: 2 additions & 0 deletions src/unix/linux_like/emscripten/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ s! {
pub sem_flg: c_short,
}

// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct sigaction {
pub sa_sigaction: crate::sighandler_t,
pub sa_mask: crate::sigset_t,
Expand Down
2 changes: 2 additions & 0 deletions src/unix/linux_like/linux/gnu/b32/arm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ use crate::{off64_t, off_t};
pub type wchar_t = u32;

s! {
// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct sigaction {
pub sa_sigaction: crate::sighandler_t,
pub sa_mask: crate::sigset_t,
Expand Down
2 changes: 2 additions & 0 deletions src/unix/linux_like/linux/gnu/b32/csky/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ use crate::{off64_t, off_t};
pub type wchar_t = u32;

s! {
// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct sigaction {
pub sa_sigaction: crate::sighandler_t,
pub sa_mask: crate::sigset_t,
Expand Down
2 changes: 2 additions & 0 deletions src/unix/linux_like/linux/gnu/b32/m68k/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ use crate::{off64_t, off_t};
pub type wchar_t = i32;

s! {
// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct sigaction {
pub sa_sigaction: crate::sighandler_t,
pub sa_mask: crate::sigset_t,
Expand Down
2 changes: 2 additions & 0 deletions src/unix/linux_like/linux/gnu/b32/mips/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ s! {
__f_spare: [c_int; 6],
}

// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct sigaction {
pub sa_flags: c_int,
pub sa_sigaction: crate::sighandler_t,
Expand Down
2 changes: 2 additions & 0 deletions src/unix/linux_like/linux/gnu/b32/powerpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ use crate::{off64_t, off_t};
pub type wchar_t = i32;

s! {
// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct sigaction {
pub sa_sigaction: crate::sighandler_t,
pub sa_mask: crate::sigset_t,
Expand Down
2 changes: 2 additions & 0 deletions src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ s! {
pub ss_size: size_t,
}

// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct sigaction {
pub sa_sigaction: crate::sighandler_t,
pub sa_mask: crate::sigset_t,
Expand Down
2 changes: 2 additions & 0 deletions src/unix/linux_like/linux/gnu/b32/sparc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ use crate::{off64_t, off_t};
pub type wchar_t = i32;

s! {
// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct sigaction {
pub sa_sigaction: crate::sighandler_t,
pub sa_mask: crate::sigset_t,
Expand Down
2 changes: 2 additions & 0 deletions src/unix/linux_like/linux/gnu/b32/x86/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ pub type wchar_t = i32;
pub type greg_t = i32;

s! {
// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct sigaction {
pub sa_sigaction: crate::sighandler_t,
pub sa_mask: crate::sigset_t,
Expand Down
2 changes: 2 additions & 0 deletions src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ pub type __u64 = c_ulonglong;
pub type __s64 = c_longlong;

s! {
// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct sigaction {
pub sa_sigaction: crate::sighandler_t,
pub sa_mask: crate::sigset_t,
Expand Down
2 changes: 2 additions & 0 deletions src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ s! {
__size: [c_ulong; 7],
}

// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct sigaction {
pub sa_sigaction: crate::sighandler_t,
pub sa_mask: crate::sigset_t,
Expand Down
2 changes: 2 additions & 0 deletions src/unix/linux_like/linux/gnu/b64/mips64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ s! {
__size: [c_ulong; 7],
}

// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct sigaction {
pub sa_flags: c_int,
pub sa_sigaction: crate::sighandler_t,
Expand Down
2 changes: 2 additions & 0 deletions src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ pub type __u64 = c_ulong;
pub type __s64 = c_long;

s! {
// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct sigaction {
pub sa_sigaction: crate::sighandler_t,
pub sa_mask: crate::sigset_t,
Expand Down
2 changes: 2 additions & 0 deletions src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ s! {
pub ss_size: size_t,
}

// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct sigaction {
pub sa_sigaction: crate::sighandler_t,
pub sa_mask: crate::sigset_t,
Expand Down
2 changes: 2 additions & 0 deletions src/unix/linux_like/linux/gnu/b64/s390x.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ pub type __u64 = u64;
pub type __s64 = i64;

s! {
// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct sigaction {
pub sa_sigaction: crate::sighandler_t,
__glibc_reserved0: c_int,
Expand Down
2 changes: 2 additions & 0 deletions src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ pub type __u64 = c_ulonglong;
pub type __s64 = c_longlong;

s! {
// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct sigaction {
pub sa_sigaction: crate::sighandler_t,
pub sa_mask: crate::sigset_t,
Expand Down
2 changes: 2 additions & 0 deletions src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ pub type __u64 = c_ulonglong;
pub type __s64 = c_longlong;

s! {
// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct sigaction {
pub sa_sigaction: crate::sighandler_t,
pub sa_mask: crate::sigset_t,
Expand Down
2 changes: 2 additions & 0 deletions src/unix/linux_like/linux/musl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ impl siginfo_t {
}

s! {
// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct sigaction {
pub sa_sigaction: crate::sighandler_t,
pub sa_mask: crate::sigset_t,
Expand Down
2 changes: 2 additions & 0 deletions src/unix/linux_like/linux/uclibc/arm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ s! {
__val: [c_ulong; 2],
}

// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct sigaction {
pub sa_sigaction: crate::sighandler_t,
pub sa_flags: c_ulong,
Expand Down
2 changes: 2 additions & 0 deletions src/unix/linux_like/linux/uclibc/x86_64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ s! {
st_pad4: [c_long; 3],
}

// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct sigaction {
pub sa_handler: crate::sighandler_t,
pub sa_flags: c_ulong,
Expand Down
2 changes: 2 additions & 0 deletions src/unix/linux_like/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ missing! {
}

s! {
// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct __c_anonymous_sigev_thread {
pub _function: Option<extern "C" fn(crate::sigval) -> *mut c_void>,
pub _attribute: *mut crate::pthread_attr_t,
Expand Down
2 changes: 2 additions & 0 deletions src/unix/nto/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,8 @@ s! {
re_g: *mut c_void,
}

// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct _thread_attr {
pub __flags: c_int,
pub __stacksize: size_t,
Expand Down
2 changes: 2 additions & 0 deletions src/unix/nto/neutrino.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ s! {
pub ev: crate::__c_anonymous_struct_ev,
}

// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct _sighandler_info {
pub siginfo: crate::siginfo_t,
pub handler: Option<unsafe extern "C" fn(value: c_int)>,
Expand Down
2 changes: 2 additions & 0 deletions src/unix/redox/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ s! {
pub pw_shell: *mut c_char,
}

// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct sigaction {
pub sa_sigaction: crate::sighandler_t,
pub sa_flags: c_ulong,
Expand Down
Loading