From 7457aa18e15860ff5d5448465dbad15f7438814a Mon Sep 17 00:00:00 2001 From: Juan Aguilar Santillana Date: Sat, 7 Dec 2024 03:04:21 +0100 Subject: [PATCH] fix: make Debug impl for unions opaque (backport ) (cherry picked from commit 6faa521f32fc11db9fc43a248a64463ce288b48d) [ resolve conflicts and update based on some main vs. 0.2 differences - Trevor ] --- src/macros.rs | 7 ++ src/unix/aix/mod.rs | 17 ----- src/unix/aix/powerpc64.rs | 26 -------- src/unix/bsd/apple/mod.rs | 65 ------------------- src/unix/bsd/freebsdlike/freebsd/mod.rs | 60 ----------------- .../bsd/freebsdlike/freebsd/x86_64/mod.rs | 7 -- src/unix/bsd/netbsdlike/netbsd/aarch64.rs | 13 ---- src/unix/bsd/netbsdlike/netbsd/mod.rs | 22 ------- src/unix/bsd/netbsdlike/netbsd/riscv64.rs | 1 - src/unix/bsd/netbsdlike/openbsd/mod.rs | 24 ------- src/unix/haiku/native.rs | 25 ------- src/unix/linux_like/android/b32/arm.rs | 7 -- src/unix/linux_like/android/b32/x86/mod.rs | 7 -- src/unix/linux_like/android/b64/x86_64/mod.rs | 7 -- src/unix/linux_like/android/mod.rs | 27 -------- .../linux_like/linux/gnu/b32/riscv32/mod.rs | 1 - .../linux_like/linux/gnu/b64/riscv64/mod.rs | 1 - src/unix/linux_like/linux/mod.rs | 64 ------------------ .../linux_like/linux/musl/b64/riscv64/mod.rs | 1 - src/unix/nto/x86_64.rs | 12 ---- src/unix/solarish/mod.rs | 20 ------ src/unix/solarish/solaris.rs | 1 - src/unix/solarish/x86_64.rs | 10 --- src/vxworks/mod.rs | 19 ------ 24 files changed, 7 insertions(+), 437 deletions(-) diff --git a/src/macros.rs b/src/macros.rs index 3bfac90518ad..b4db0fd469da 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -159,6 +159,13 @@ macro_rules! s_no_extra_traits { $(#[$attr])* pub union $i { $($field)* } } + + #[cfg(feature = "extra_traits")] + impl ::core::fmt::Debug for $i { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_struct(::core::stringify!($i)).finish_non_exhaustive() + } + } ); (it: $(#[$attr:meta])* pub struct $i:ident { $($field:tt)* }) => ( diff --git a/src/unix/aix/mod.rs b/src/unix/aix/mod.rs index bd087ea334dd..6e98709dc546 100644 --- a/src/unix/aix/mod.rs +++ b/src/unix/aix/mod.rs @@ -575,14 +575,6 @@ cfg_if! { } } impl Eq for __sigaction_sa_union {} - impl fmt::Debug for __sigaction_sa_union { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("__sigaction_sa_union") - .field("__su_handler", unsafe { &self.__su_handler }) - .field("__su_sigaction", unsafe { &self.__su_sigaction }) - .finish() - } - } impl hash::Hash for __sigaction_sa_union { fn hash(&self, state: &mut H) { unsafe { @@ -627,15 +619,6 @@ cfg_if! { } } impl Eq for __poll_ctl_ext_u {} - impl fmt::Debug for __poll_ctl_ext_u { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("__poll_ctl_ext_u") - .field("addr", unsafe { &self.addr }) - .field("data32", unsafe { &self.data32 }) - .field("data", unsafe { &self.data }) - .finish() - } - } impl hash::Hash for __poll_ctl_ext_u { fn hash(&self, state: &mut H) { unsafe { diff --git a/src/unix/aix/powerpc64.rs b/src/unix/aix/powerpc64.rs index e9f5b1e1cf3a..921774611e29 100644 --- a/src/unix/aix/powerpc64.rs +++ b/src/unix/aix/powerpc64.rs @@ -356,14 +356,6 @@ cfg_if! { } } impl Eq for _kernel_simple_lock {} - impl fmt::Debug for _kernel_simple_lock { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("_kernel_simple_lock") - .field("_slock", unsafe { &self._slock }) - .field("_slockp", unsafe { &self._slockp }) - .finish() - } - } impl hash::Hash for _kernel_simple_lock { fn hash(&self, state: &mut H) { unsafe { @@ -475,15 +467,6 @@ cfg_if! { } } impl Eq for __ld_info_file {} - impl fmt::Debug for __ld_info_file { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("__ld_info_file") - .field("_ldinfo_fd", unsafe { &self._ldinfo_fd }) - .field("_ldinfo_fp", unsafe { &self._ldinfo_fp }) - .field("_core_offset", unsafe { &self._core_offset }) - .finish() - } - } impl hash::Hash for __ld_info_file { fn hash(&self, state: &mut H) { unsafe { @@ -544,15 +527,6 @@ cfg_if! { } } impl Eq for __pollfd_ext_u {} - impl fmt::Debug for __pollfd_ext_u { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("__pollfd_ext_u") - .field("addr", unsafe { &self.addr }) - .field("data32", unsafe { &self.data32 }) - .field("data", unsafe { &self.data }) - .finish() - } - } impl hash::Hash for __pollfd_ext_u { fn hash(&self, state: &mut H) { unsafe { diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs index 89c0e3197a9d..943d9e400ecc 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -1718,13 +1718,6 @@ cfg_if! { } } impl Eq for semun {} - impl fmt::Debug for semun { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("semun") - .field("val", unsafe { &self.val }) - .finish() - } - } impl hash::Hash for semun { fn hash(&self, state: &mut H) { unsafe { self.val.hash(state) }; @@ -3073,15 +3066,6 @@ cfg_if! { } impl Eq for __c_anonymous_ifk_data {} - - impl fmt::Debug for __c_anonymous_ifk_data { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("__c_anonymous_ifk_data") - .field("ifk_ptr", unsafe { &self.ifk_ptr }) - .field("ifk_value", unsafe { &self.ifk_value }) - .finish() - } - } impl hash::Hash for __c_anonymous_ifk_data { fn hash(&self, state: &mut H) { unsafe { @@ -3144,31 +3128,6 @@ cfg_if! { impl Eq for __c_anonymous_ifr_ifru {} - impl fmt::Debug for __c_anonymous_ifr_ifru { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("__c_anonymous_ifr_ifru") - .field("ifru_addr", unsafe { &self.ifru_addr }) - .field("ifru_dstaddr", unsafe { &self.ifru_dstaddr }) - .field("ifru_broadaddr", unsafe { &self.ifru_broadaddr }) - .field("ifru_flags", unsafe { &self.ifru_flags }) - .field("ifru_metrics", unsafe { &self.ifru_metrics }) - .field("ifru_mtu", unsafe { &self.ifru_mtu }) - .field("ifru_phys", unsafe { &self.ifru_phys }) - .field("ifru_media", unsafe { &self.ifru_media }) - .field("ifru_intval", unsafe { &self.ifru_intval }) - .field("ifru_data", unsafe { &self.ifru_data }) - .field("ifru_devmtu", unsafe { &self.ifru_devmtu }) - .field("ifru_kpi", unsafe { &self.ifru_kpi }) - .field("ifru_wake_flags", unsafe { &self.ifru_wake_flags }) - .field("ifru_route_refcnt", unsafe { &self.ifru_route_refcnt }) - .field("ifru_cap", unsafe { &self.ifru_cap }) - .field("ifru_functional_type", unsafe { - &self.ifru_functional_type - }) - .finish() - } - } - impl hash::Hash for __c_anonymous_ifr_ifru { fn hash(&self, state: &mut H) { unsafe { @@ -3224,15 +3183,6 @@ cfg_if! { } } - impl fmt::Debug for __c_anonymous_ifc_ifcu { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("ifc_ifcu") - .field("ifcu_buf", unsafe { &self.ifcu_buf }) - .field("ifcu_req", unsafe { &self.ifcu_req }) - .finish() - } - } - impl hash::Hash for __c_anonymous_ifc_ifcu { fn hash(&self, state: &mut H) { unsafe { self.ifcu_buf.hash(state) }; @@ -3261,21 +3211,6 @@ cfg_if! { impl Eq for __c_anonymous_ifr_ifru6 {} - impl fmt::Debug for __c_anonymous_ifr_ifru6 { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("__c_anonymous_ifr_ifru6") - .field("ifru_addr", unsafe { &self.ifru_addr }) - .field("ifru_dstaddr", unsafe { &self.ifru_dstaddr }) - .field("ifru_flags", unsafe { &self.ifru_flags }) - .field("ifru_flags6", unsafe { &self.ifru_flags6 }) - .field("ifru_metrics", unsafe { &self.ifru_metrics }) - .field("ifru_intval", unsafe { &self.ifru_intval }) - .field("ifru_data", unsafe { &self.ifru_data }) - .field("ifru_scope_id", unsafe { &self.ifru_scope_id }) - .finish() - } - } - impl hash::Hash for __c_anonymous_ifr_ifru6 { fn hash(&self, state: &mut H) { unsafe { diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs index 6cbe59d890af..72e5e7fdae55 100644 --- a/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -1698,13 +1698,6 @@ cfg_if! { } } impl Eq for __c_anonymous_cr_pid {} - impl fmt::Debug for __c_anonymous_cr_pid { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("cr_pid") - .field("cr_pid", unsafe { &self.cr_pid }) - .finish() - } - } impl hash::Hash for __c_anonymous_cr_pid { fn hash(&self, state: &mut H) { unsafe { self.cr_pid.hash(state) }; @@ -1876,13 +1869,6 @@ cfg_if! { } } impl Eq for __c_anonymous_elf32_auxv_union {} - impl fmt::Debug for __c_anonymous_elf32_auxv_union { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("a_val") - .field("a_val", unsafe { &self.a_val }) - .finish() - } - } impl PartialEq for Elf32_Auxinfo { fn eq(&self, other: &Elf32_Auxinfo) -> bool { self.a_type == other.a_type && self.a_un == other.a_un @@ -1920,27 +1906,6 @@ cfg_if! { } } impl Eq for __c_anonymous_ifr_ifru {} - impl fmt::Debug for __c_anonymous_ifr_ifru { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("ifr_ifru") - .field("ifru_addr", unsafe { &self.ifru_addr }) - .field("ifru_dstaddr", unsafe { &self.ifru_dstaddr }) - .field("ifru_broadaddr", unsafe { &self.ifru_broadaddr }) - .field("ifru_buffer", unsafe { &self.ifru_buffer }) - .field("ifru_flags", unsafe { &self.ifru_flags }) - .field("ifru_index", unsafe { &self.ifru_index }) - .field("ifru_jid", unsafe { &self.ifru_jid }) - .field("ifru_metric", unsafe { &self.ifru_metric }) - .field("ifru_mtu", unsafe { &self.ifru_mtu }) - .field("ifru_phys", unsafe { &self.ifru_phys }) - .field("ifru_media", unsafe { &self.ifru_media }) - .field("ifru_data", unsafe { &self.ifru_data }) - .field("ifru_cap", unsafe { &self.ifru_cap }) - .field("ifru_fib", unsafe { &self.ifru_fib }) - .field("ifru_vlan_pcp", unsafe { &self.ifru_vlan_pcp }) - .finish() - } - } impl hash::Hash for __c_anonymous_ifr_ifru { fn hash(&self, state: &mut H) { unsafe { self.ifru_addr.hash(state) }; @@ -1990,15 +1955,6 @@ cfg_if! { } } - impl fmt::Debug for __c_anonymous_ifc_ifcu { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("ifc_ifcu") - .field("ifcu_buf", unsafe { &self.ifcu_buf }) - .field("ifcu_req", unsafe { &self.ifcu_req }) - .finish() - } - } - impl hash::Hash for __c_anonymous_ifc_ifcu { fn hash(&self, state: &mut H) { unsafe { self.ifcu_buf.hash(state) }; @@ -2107,14 +2063,6 @@ cfg_if! { } } impl Eq for __c_anonymous_ifi_epoch {} - impl fmt::Debug for __c_anonymous_ifi_epoch { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("__c_anonymous_ifi_epoch") - .field("tt", unsafe { &self.tt }) - .field("ph", unsafe { &self.ph }) - .finish() - } - } impl hash::Hash for __c_anonymous_ifi_epoch { fn hash(&self, state: &mut H) { unsafe { @@ -2130,14 +2078,6 @@ cfg_if! { } } impl Eq for __c_anonymous_ifi_lastchange {} - impl fmt::Debug for __c_anonymous_ifi_lastchange { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("__c_anonymous_ifi_lastchange") - .field("tv", unsafe { &self.tv }) - .field("ph", unsafe { &self.ph }) - .finish() - } - } impl hash::Hash for __c_anonymous_ifi_lastchange { fn hash(&self, state: &mut H) { unsafe { diff --git a/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs b/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs index a73766a65c7d..fca9a126f81c 100644 --- a/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs @@ -250,13 +250,6 @@ cfg_if! { } } impl Eq for __c_anonymous_elf64_auxv_union {} - impl fmt::Debug for __c_anonymous_elf64_auxv_union { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("a_val") - .field("a_val", unsafe { &self.a_val }) - .finish() - } - } impl PartialEq for Elf64_Auxinfo { fn eq(&self, other: &Elf64_Auxinfo) -> bool { self.a_type == other.a_type && self.a_un == other.a_un diff --git a/src/unix/bsd/netbsdlike/netbsd/aarch64.rs b/src/unix/bsd/netbsdlike/netbsd/aarch64.rs index 8ed84021e895..2391801fe458 100644 --- a/src/unix/bsd/netbsdlike/netbsd/aarch64.rs +++ b/src/unix/bsd/netbsdlike/netbsd/aarch64.rs @@ -54,19 +54,6 @@ cfg_if! { } } impl Eq for __c_anonymous__freg {} - impl fmt::Debug for __c_anonymous__freg { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - unsafe { - f.debug_struct("__c_anonymous__freg") - .field("__b8", &self.__b8) - .field("__h16", &self.__h16) - .field("__s32", &self.__s32) - .field("__d64", &self.__d64) - .field("__q128", &self.__q128) - .finish() - } - } - } impl hash::Hash for __c_anonymous__freg { fn hash(&self, state: &mut H) { unsafe { diff --git a/src/unix/bsd/netbsdlike/netbsd/mod.rs b/src/unix/bsd/netbsdlike/netbsd/mod.rs index 9af0efc40f97..8e3507fc743a 100644 --- a/src/unix/bsd/netbsdlike/netbsd/mod.rs +++ b/src/unix/bsd/netbsdlike/netbsd/mod.rs @@ -1340,17 +1340,6 @@ cfg_if! { } } - impl fmt::Debug for __c_anonymous_posix_spawn_fae { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - unsafe { - f.debug_struct("__c_anonymous_posix_fae") - .field("open", &self.open) - .field("dup2", &self.dup2) - .finish() - } - } - } - impl hash::Hash for __c_anonymous_posix_spawn_fae { fn hash(&self, state: &mut H) { unsafe { @@ -1368,17 +1357,6 @@ cfg_if! { } } - impl fmt::Debug for __c_anonymous_ifc_ifcu { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - unsafe { - f.debug_struct("__c_anonymous_ifc_ifcu") - .field("ifcu_buf", &self.ifcu_buf) - .field("ifcu_req", &self.ifcu_req) - .finish() - } - } - } - impl hash::Hash for __c_anonymous_ifc_ifcu { fn hash(&self, state: &mut H) { unsafe { diff --git a/src/unix/bsd/netbsdlike/netbsd/riscv64.rs b/src/unix/bsd/netbsdlike/netbsd/riscv64.rs index b5e72084d5aa..68cd264aadb7 100644 --- a/src/unix/bsd/netbsdlike/netbsd/riscv64.rs +++ b/src/unix/bsd/netbsdlike/netbsd/riscv64.rs @@ -19,7 +19,6 @@ s! { } s_no_extra_traits! { - #[cfg_attr(feature = "extra_traits", allow(missing_debug_implementations))] pub union __fpreg { pub u_u64: u64, pub u_d: c_double, diff --git a/src/unix/bsd/netbsdlike/openbsd/mod.rs b/src/unix/bsd/netbsdlike/openbsd/mod.rs index 515b3ba9d05f..f86919264c0a 100644 --- a/src/unix/bsd/netbsdlike/openbsd/mod.rs +++ b/src/unix/bsd/netbsdlike/openbsd/mod.rs @@ -944,14 +944,6 @@ cfg_if! { impl Eq for mount_info {} - impl fmt::Debug for mount_info { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("mount_info") - // FIXME: .field("align", &self.align) - .finish() - } - } - impl hash::Hash for mount_info { fn hash(&self, state: &mut H) { unsafe { self.align.hash(state) }; @@ -976,22 +968,6 @@ cfg_if! { impl Eq for __c_anonymous_ifr_ifru {} - impl fmt::Debug for __c_anonymous_ifr_ifru { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("__c_anonymous_ifr_ifru") - .field("ifru_addr", unsafe { &self.ifru_addr }) - .field("ifru_dstaddr", unsafe { &self.ifru_dstaddr }) - .field("ifru_broadaddr", unsafe { &self.ifru_broadaddr }) - .field("ifru_flags", unsafe { &self.ifru_flags }) - .field("ifru_metric", unsafe { &self.ifru_metric }) - .field("ifru_vnetid", unsafe { &self.ifru_vnetid }) - .field("ifru_media", unsafe { &self.ifru_media }) - .field("ifru_data", unsafe { &self.ifru_data }) - .field("ifru_index", unsafe { &self.ifru_index }) - .finish() - } - } - impl hash::Hash for __c_anonymous_ifr_ifru { fn hash(&self, state: &mut H) { unsafe { diff --git a/src/unix/haiku/native.rs b/src/unix/haiku/native.rs index 84ca0e146294..d373a9ced086 100644 --- a/src/unix/haiku/native.rs +++ b/src/unix/haiku/native.rs @@ -501,20 +501,6 @@ cfg_if! { } } impl Eq for cpuid_info {} - impl fmt::Debug for cpuid_info { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - unsafe { - f.debug_struct("cpuid_info") - .field("eax_0", &self.eax_0) - .field("eax_1", &self.eax_1) - .field("eax_2", &self.eax_2) - .field("eax_3", &self.eax_3) - .field("as_chars", &self.as_chars) - .field("regs", &self.regs) - .finish() - } - } - } impl PartialEq for __c_anonymous_cpu_topology_info_data { fn eq(&self, other: &__c_anonymous_cpu_topology_info_data) -> bool { @@ -526,17 +512,6 @@ cfg_if! { } } impl Eq for __c_anonymous_cpu_topology_info_data {} - impl fmt::Debug for __c_anonymous_cpu_topology_info_data { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - unsafe { - f.debug_struct("__c_anonymous_cpu_topology_info_data") - .field("root", &self.root) - .field("package", &self.package) - .field("core", &self.core) - .finish() - } - } - } impl PartialEq for cpu_topology_node_info { fn eq(&self, other: &cpu_topology_node_info) -> bool { diff --git a/src/unix/linux_like/android/b32/arm.rs b/src/unix/linux_like/android/b32/arm.rs index 8a3b02dcc402..0bf4087fde75 100644 --- a/src/unix/linux_like/android/b32/arm.rs +++ b/src/unix/linux_like/android/b32/arm.rs @@ -87,13 +87,6 @@ cfg_if! { } } impl Eq for __c_anonymous_uc_sigmask {} - impl fmt::Debug for __c_anonymous_uc_sigmask { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("uc_sigmask") - .field("uc_sigmask", unsafe { &self.uc_sigmask }) - .finish() - } - } impl hash::Hash for __c_anonymous_uc_sigmask { fn hash(&self, state: &mut H) { unsafe { self.uc_sigmask.hash(state) } diff --git a/src/unix/linux_like/android/b32/x86/mod.rs b/src/unix/linux_like/android/b32/x86/mod.rs index 8421f389ed9c..9f80d8a71f44 100644 --- a/src/unix/linux_like/android/b32/x86/mod.rs +++ b/src/unix/linux_like/android/b32/x86/mod.rs @@ -89,13 +89,6 @@ cfg_if! { } } impl Eq for __c_anonymous_uc_sigmask {} - impl fmt::Debug for __c_anonymous_uc_sigmask { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("uc_sigmask") - .field("uc_sigmask", unsafe { &self.uc_sigmask }) - .finish() - } - } impl hash::Hash for __c_anonymous_uc_sigmask { fn hash(&self, state: &mut H) { unsafe { self.uc_sigmask.hash(state) } diff --git a/src/unix/linux_like/android/b64/x86_64/mod.rs b/src/unix/linux_like/android/b64/x86_64/mod.rs index 2118b926af9c..4da5cd499567 100644 --- a/src/unix/linux_like/android/b64/x86_64/mod.rs +++ b/src/unix/linux_like/android/b64/x86_64/mod.rs @@ -128,13 +128,6 @@ cfg_if! { } } impl Eq for __c_anonymous_uc_sigmask {} - impl fmt::Debug for __c_anonymous_uc_sigmask { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("uc_sigmask") - .field("uc_sigmask", unsafe { &self.uc_sigmask }) - .finish() - } - } impl hash::Hash for __c_anonymous_uc_sigmask { fn hash(&self, state: &mut H) { unsafe { self.uc_sigmask.hash(state) } diff --git a/src/unix/linux_like/android/mod.rs b/src/unix/linux_like/android/mod.rs index 8f477be82c94..f408969175d3 100644 --- a/src/unix/linux_like/android/mod.rs +++ b/src/unix/linux_like/android/mod.rs @@ -994,25 +994,6 @@ cfg_if! { } } - impl fmt::Debug for __c_anonymous_ifr_ifru { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("ifr_ifru") - .field("ifru_addr", unsafe { &self.ifru_addr }) - .field("ifru_dstaddr", unsafe { &self.ifru_dstaddr }) - .field("ifru_broadaddr", unsafe { &self.ifru_broadaddr }) - .field("ifru_netmask", unsafe { &self.ifru_netmask }) - .field("ifru_hwaddr", unsafe { &self.ifru_hwaddr }) - .field("ifru_flags", unsafe { &self.ifru_flags }) - .field("ifru_ifindex", unsafe { &self.ifru_ifindex }) - .field("ifru_metric", unsafe { &self.ifru_metric }) - .field("ifru_mtu", unsafe { &self.ifru_mtu }) - .field("ifru_map", unsafe { &self.ifru_map }) - .field("ifru_slave", unsafe { &self.ifru_slave }) - .field("ifru_newname", unsafe { &self.ifru_newname }) - .field("ifru_data", unsafe { &self.ifru_data }) - .finish() - } - } impl fmt::Debug for ifreq { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("ifreq") @@ -1022,14 +1003,6 @@ cfg_if! { } } - impl fmt::Debug for __c_anonymous_ifc_ifcu { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("ifr_ifru") - .field("ifcu_buf", unsafe { &self.ifcu_buf }) - .field("ifcu_req", unsafe { &self.ifcu_req }) - .finish() - } - } impl fmt::Debug for ifconf { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("ifconf") diff --git a/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs b/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs index 4ab40c628a1e..43547cc7ad86 100644 --- a/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs +++ b/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs @@ -212,7 +212,6 @@ s_no_extra_traits! { pub __fpregs: __riscv_mc_fp_state, } - #[allow(missing_debug_implementations)] pub union __riscv_mc_fp_state { pub __f: __riscv_mc_f_ext_state, pub __d: __riscv_mc_d_ext_state, diff --git a/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs b/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs index 6eaa3cda10fc..db8deafe896b 100644 --- a/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs +++ b/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs @@ -264,7 +264,6 @@ s_no_extra_traits! { pub __fpregs: __riscv_mc_fp_state, } - #[allow(missing_debug_implementations)] pub union __riscv_mc_fp_state { pub __f: __riscv_mc_f_ext_state, pub __d: __riscv_mc_d_ext_state, diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs index e01a4d67e91e..7321d37a684c 100644 --- a/src/unix/linux_like/linux/mod.rs +++ b/src/unix/linux_like/linux/mod.rs @@ -1669,13 +1669,11 @@ s_no_extra_traits! { } // linux/ptp_clock.h - #[allow(missing_debug_implementations)] pub union __c_anonymous_ptp_perout_request_1 { pub start: ptp_clock_time, pub phase: ptp_clock_time, } - #[allow(missing_debug_implementations)] pub union __c_anonymous_ptp_perout_request_2 { pub on: ptp_clock_time, pub rsv: [c_uint; 4], @@ -1697,7 +1695,6 @@ s_no_extra_traits! { pub xsk_tx_metadata_union: __c_anonymous_xsk_tx_metadata_union, } - #[allow(missing_debug_implementations)] pub union __c_anonymous_xsk_tx_metadata_union { pub request: xsk_tx_metadata_request, pub completion: xsk_tx_metadata_completion, @@ -2063,25 +2060,6 @@ cfg_if! { self.mq_curmsgs.hash(state); } } - impl fmt::Debug for __c_anonymous_ifr_ifru { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("ifr_ifru") - .field("ifru_addr", unsafe { &self.ifru_addr }) - .field("ifru_dstaddr", unsafe { &self.ifru_dstaddr }) - .field("ifru_broadaddr", unsafe { &self.ifru_broadaddr }) - .field("ifru_netmask", unsafe { &self.ifru_netmask }) - .field("ifru_hwaddr", unsafe { &self.ifru_hwaddr }) - .field("ifru_flags", unsafe { &self.ifru_flags }) - .field("ifru_ifindex", unsafe { &self.ifru_ifindex }) - .field("ifru_metric", unsafe { &self.ifru_metric }) - .field("ifru_mtu", unsafe { &self.ifru_mtu }) - .field("ifru_map", unsafe { &self.ifru_map }) - .field("ifru_slave", unsafe { &self.ifru_slave }) - .field("ifru_newname", unsafe { &self.ifru_newname }) - .field("ifru_data", unsafe { &self.ifru_data }) - .finish() - } - } impl fmt::Debug for ifreq { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("ifreq") @@ -2090,15 +2068,6 @@ cfg_if! { .finish() } } - - impl fmt::Debug for __c_anonymous_ifc_ifcu { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("ifr_ifru") - .field("ifcu_buf", unsafe { &self.ifcu_buf }) - .field("ifcu_req", unsafe { &self.ifcu_req }) - .finish() - } - } impl fmt::Debug for ifconf { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("ifconf") @@ -2172,31 +2141,6 @@ cfg_if! { } } - impl fmt::Debug for iwreq_data { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("iwreq_data") - .field("name", unsafe { &self.name }) - .field("essid", unsafe { &self.essid }) - .field("nwid", unsafe { &self.nwid }) - .field("freq", unsafe { &self.freq }) - .field("sens", unsafe { &self.sens }) - .field("bitrate", unsafe { &self.bitrate }) - .field("txpower", unsafe { &self.txpower }) - .field("rts", unsafe { &self.rts }) - .field("frag", unsafe { &self.frag }) - .field("mode", unsafe { &self.mode }) - .field("retry", unsafe { &self.retry }) - .field("encoding", unsafe { &self.encoding }) - .field("power", unsafe { &self.power }) - .field("qual", unsafe { &self.qual }) - .field("ap_addr", unsafe { &self.ap_addr }) - .field("addr", unsafe { &self.addr }) - .field("param", unsafe { &self.param }) - .field("data", unsafe { &self.data }) - .finish() - } - } - impl fmt::Debug for iw_event { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("iw_event") @@ -2207,14 +2151,6 @@ cfg_if! { } } - impl fmt::Debug for __c_anonymous_iwreq { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("__c_anonymous_iwreq") - .field("ifrn_name", unsafe { &self.ifrn_name }) - .finish() - } - } - impl fmt::Debug for iwreq { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("iwreq") diff --git a/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs b/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs index 729e87366887..ec0ba4c1f926 100644 --- a/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs +++ b/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs @@ -103,7 +103,6 @@ s_no_extra_traits! { pub __fpregs: __riscv_mc_fp_state, } - #[allow(missing_debug_implementations)] pub union __riscv_mc_fp_state { pub __f: __riscv_mc_f_ext_state, pub __d: __riscv_mc_d_ext_state, diff --git a/src/unix/nto/x86_64.rs b/src/unix/nto/x86_64.rs index 8e938c3bba4f..425f47994946 100644 --- a/src/unix/nto/x86_64.rs +++ b/src/unix/nto/x86_64.rs @@ -101,18 +101,6 @@ cfg_if! { } } - impl fmt::Debug for x86_64_fpu_registers { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - unsafe { - f.debug_struct("x86_64_fpu_registers") - .field("fsave_area", &self.fsave_area) - .field("fxsave_area", &self.fxsave_area) - .field("xsave_area", &self.xsave_area) - .finish() - } - } - } - impl hash::Hash for x86_64_fpu_registers { fn hash(&self, state: &mut H) { unsafe { diff --git a/src/unix/solarish/mod.rs b/src/unix/solarish/mod.rs index 8cefc64e5718..6f35a1e71284 100644 --- a/src/unix/solarish/mod.rs +++ b/src/unix/solarish/mod.rs @@ -859,16 +859,6 @@ cfg_if! { } } impl Eq for pad128_t {} - impl fmt::Debug for pad128_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - unsafe { - f.debug_struct("pad128_t") - // FIXME: .field("_q", &{self._q}) - .field("_l", &{ self._l }) - .finish() - } - } - } impl hash::Hash for pad128_t { fn hash(&self, state: &mut H) { unsafe { @@ -886,16 +876,6 @@ cfg_if! { } } impl Eq for upad128_t {} - impl fmt::Debug for upad128_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - unsafe { - f.debug_struct("upad128_t") - // FIXME: .field("_q", &{self._q}) - .field("_l", &{ self._l }) - .finish() - } - } - } impl hash::Hash for upad128_t { fn hash(&self, state: &mut H) { unsafe { diff --git a/src/unix/solarish/solaris.rs b/src/unix/solarish/solaris.rs index f4a803175679..d080e6ce8d7f 100644 --- a/src/unix/solarish/solaris.rs +++ b/src/unix/solarish/solaris.rs @@ -65,7 +65,6 @@ s_no_extra_traits! { pub d_id: crate::door_id_t, } - #[cfg_attr(feature = "extra_traits", allow(missing_debug_implementations))] pub union door_desc_t__d_data { pub d_desc: door_desc_t__d_data__d_desc, d_resv: [c_int; 5], /* Check out /usr/include/sys/door.h */ diff --git a/src/unix/solarish/x86_64.rs b/src/unix/solarish/x86_64.rs index 1ea8ce987dab..4deaac0fc171 100644 --- a/src/unix/solarish/x86_64.rs +++ b/src/unix/solarish/x86_64.rs @@ -110,16 +110,6 @@ cfg_if! { } } impl Eq for __c_anonymous_fp_reg_set {} - impl fmt::Debug for __c_anonymous_fp_reg_set { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - unsafe { - f.debug_struct("__c_anonymous_fp_reg_set") - .field("fpchip_state", &{ self.fpchip_state }) - .field("f_fpregs", &{ self.f_fpregs }) - .finish() - } - } - } impl PartialEq for fpregset_t { fn eq(&self, other: &fpregset_t) -> bool { self.fp_reg_set == other.fp_reg_set diff --git a/src/vxworks/mod.rs b/src/vxworks/mod.rs index f5e582055a5c..b8faf16e9aa1 100644 --- a/src/vxworks/mod.rs +++ b/src/vxworks/mod.rs @@ -525,18 +525,6 @@ cfg_if! { } } impl Eq for sa_u_t {} - impl fmt::Debug for sa_u_t { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - unsafe { - let h = match self.sa_handler { - Some(handler) => handler as usize, - None => 0 as usize, - }; - - f.debug_struct("sa_u_t").field("sa_handler", &h).finish() - } - } - } impl hash::Hash for sa_u_t { fn hash(&self, state: &mut H) { unsafe { @@ -555,13 +543,6 @@ cfg_if! { } } impl Eq for sigval {} - impl fmt::Debug for sigval { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("sigval") - .field("sival_ptr", unsafe { &(self.sival_ptr as usize) }) - .finish() - } - } impl hash::Hash for sigval { fn hash(&self, state: &mut H) { unsafe { (self.sival_ptr as usize).hash(state) };