Skip to content

[0.2] Backports #4499

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 6 commits into from
Jun 17, 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
14 changes: 14 additions & 0 deletions src/psp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1415,6 +1415,8 @@ s! {
pub stack: [u32; 8],
}

// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct GeCallbackData {
pub signal_func: Option<extern "C" fn(id: i32, arg: *mut c_void)>,
pub signal_arg: *mut c_void,
Expand Down Expand Up @@ -1537,6 +1539,8 @@ s! {
pub stack_mpid: SceUid,
}

// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct SceKernelThreadInfo {
pub size: usize,
pub name: [u8; 32],
Expand Down Expand Up @@ -1611,6 +1615,8 @@ s! {
pub first_message: *mut c_void,
}

// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct SceKernelVTimerInfo {
pub size: usize,
pub name: [u8; 32],
Expand All @@ -1622,6 +1628,8 @@ s! {
pub common: *mut c_void,
}

// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct SceKernelThreadEventHandlerInfo {
pub size: usize,
pub name: [u8; 32],
Expand All @@ -1631,6 +1639,8 @@ s! {
pub common: *mut c_void,
}

// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct SceKernelAlarmInfo {
pub size: usize,
pub schedule: SceKernelSysClock,
Expand Down Expand Up @@ -1688,6 +1698,8 @@ s! {
pub size: usize,
}

// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct SceKernelCallbackInfo {
pub size: usize,
pub name: [u8; 32usize],
Expand Down Expand Up @@ -1787,6 +1799,8 @@ s! {
pub type_: UmdType,
}

// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct SceMpegRingbuffer {
pub packets: i32,
pub unk0: u32,
Expand Down
2 changes: 2 additions & 0 deletions src/unix/bsd/apple/b64/x86_64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ s! {
_private: [crate::uintptr_t; 16], // FIXME(macos): keeping private for now
}

// FIXME(1.0): This should not implement `PartialEq`
#[allow(unpredictable_function_pointer_comparisons)]
pub struct malloc_zone_t {
_reserved1: *mut c_void,
_reserved2: *mut c_void,
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; 8]; 32],
}

// 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: 1 addition & 1 deletion src/unix/bsd/freebsdlike/freebsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4662,7 +4662,7 @@ f! {
pub fn CMSG_NXTHDR(mhdr: *const crate::msghdr, cmsg: *const cmsghdr) -> *mut cmsghdr {
if cmsg.is_null() {
return crate::CMSG_FIRSTHDR(mhdr);
};
}
let next =
cmsg as usize + _ALIGN((*cmsg).cmsg_len as usize) + _ALIGN(mem::size_of::<cmsghdr>());
let max = (*mhdr).msg_control as usize + (*mhdr).msg_controllen as usize;
Expand Down
2 changes: 1 addition & 1 deletion src/unix/bsd/netbsdlike/netbsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2295,7 +2295,7 @@ f! {
pub fn CMSG_NXTHDR(mhdr: *const crate::msghdr, cmsg: *const cmsghdr) -> *mut cmsghdr {
if cmsg.is_null() {
return crate::CMSG_FIRSTHDR(mhdr);
};
}
let next =
cmsg as usize + _ALIGN((*cmsg).cmsg_len as usize) + _ALIGN(mem::size_of::<cmsghdr>());
let max = (*mhdr).msg_control as usize + (*mhdr).msg_controllen as usize;
Expand Down
8 changes: 4 additions & 4 deletions src/unix/bsd/netbsdlike/openbsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ impl siginfo_t {
_pad: [c_int; SI_PAD],
_pid: crate::pid_t,
}
(*(self as *const siginfo_t as *const siginfo_timer))._pid
(*(self as *const siginfo_t).cast::<siginfo_timer>())._pid
}

pub unsafe fn si_uid(&self) -> crate::uid_t {
Expand All @@ -643,7 +643,7 @@ impl siginfo_t {
_pid: crate::pid_t,
_uid: crate::uid_t,
}
(*(self as *const siginfo_t as *const siginfo_timer))._uid
(*(self as *const siginfo_t).cast::<siginfo_timer>())._uid
}

pub unsafe fn si_value(&self) -> crate::sigval {
Expand All @@ -657,7 +657,7 @@ impl siginfo_t {
_uid: crate::uid_t,
value: crate::sigval,
}
(*(self as *const siginfo_t as *const siginfo_timer)).value
(*(self as *const siginfo_t).cast::<siginfo_timer>()).value
}
}

Expand Down Expand Up @@ -1869,7 +1869,7 @@ f! {
pub fn CMSG_NXTHDR(mhdr: *const crate::msghdr, cmsg: *const cmsghdr) -> *mut cmsghdr {
if cmsg.is_null() {
return crate::CMSG_FIRSTHDR(mhdr);
};
}
let next =
cmsg as usize + _ALIGN((*cmsg).cmsg_len as usize) + _ALIGN(mem::size_of::<cmsghdr>());
let max = (*mhdr).msg_control as usize + (*mhdr).msg_controllen as usize;
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
2 changes: 1 addition & 1 deletion src/unix/haiku/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1533,7 +1533,7 @@ f! {
pub fn CMSG_NXTHDR(mhdr: *const msghdr, cmsg: *const cmsghdr) -> *mut cmsghdr {
if cmsg.is_null() {
return crate::CMSG_FIRSTHDR(mhdr);
};
}
let next = cmsg as usize
+ CMSG_ALIGN((*cmsg).cmsg_len as usize)
+ CMSG_ALIGN(mem::size_of::<cmsghdr>());
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: 1 addition & 1 deletion src/unix/hurd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3445,7 +3445,7 @@ f! {
pub fn CMSG_NXTHDR(mhdr: *const msghdr, cmsg: *const cmsghdr) -> *mut cmsghdr {
if ((*cmsg).cmsg_len as usize) < mem::size_of::<cmsghdr>() {
return core::ptr::null_mut::<cmsghdr>();
};
}
let next = (cmsg as usize + CMSG_ALIGN((*cmsg).cmsg_len as usize)) as *mut cmsghdr;
let max = (*mhdr).msg_control as usize + (*mhdr).msg_controllen as usize;
if (next.offset(1)) as usize > max
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
4 changes: 3 additions & 1 deletion 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 Expand Up @@ -1365,7 +1367,7 @@ f! {
pub fn CMSG_NXTHDR(mhdr: *const msghdr, cmsg: *const cmsghdr) -> *mut cmsghdr {
if ((*cmsg).cmsg_len as usize) < mem::size_of::<cmsghdr>() {
return core::ptr::null_mut::<cmsghdr>();
};
}
let next = (cmsg as usize + super::CMSG_ALIGN((*cmsg).cmsg_len as usize)) as *mut cmsghdr;
let max = (*mhdr).msg_control as usize + (*mhdr).msg_controllen as usize;
if (next.offset(1)) as usize > max {
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/gnu/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,8 @@ s! {
__pad: i32,
#[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
pub tv_nsec: c_long,
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
pub tv_nsec: i64,
#[cfg(all(gnu_time_bits64, target_endian = "little"))]
__pad: i32,
}
Expand Down
Loading
Loading