diff --git a/src/macros.rs b/src/macros.rs index a39d527919e6..c9d96b7ab290 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 10cec449c034..ca94debe8865 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 eaf924c7f323..7cce58e5d6db 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -1680,13 +1680,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) }; @@ -3009,15 +3002,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 { @@ -3080,31 +3064,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 { @@ -3158,12 +3117,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").finish_non_exhaustive() - } - } - impl PartialEq for __c_anonymous_ifr_ifru6 { fn eq(&self, other: &__c_anonymous_ifr_ifru6) -> bool { unsafe { @@ -3185,21 +3138,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 1c48b7175db1..9015f6743c63 100644 --- a/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -1365,8 +1365,6 @@ s_no_extra_traits! { pub aio_sigevent: sigevent, } - // Can't correctly impl Debug for unions - #[allow(missing_debug_implementations)] pub union __c_anonymous_sigev_un { pub _threadid: crate::__lwpid_t, pub _sigev_thread: __c_anonymous_sigev_thread, @@ -1721,13 +1719,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) }; @@ -1883,13 +1874,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 @@ -1927,27 +1911,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) }; @@ -1997,15 +1960,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) }; @@ -2114,14 +2068,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 { @@ -2137,14 +2083,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 0d8ba6038baa..1840015e1d14 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 3a94364965de..c15c2e77a149 100644 --- a/src/unix/bsd/netbsdlike/openbsd/mod.rs +++ b/src/unix/bsd/netbsdlike/openbsd/mod.rs @@ -943,14 +943,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) }; @@ -975,22 +967,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 524a6ad2c0f3..053f0bbbfdf4 100644 --- a/src/unix/linux_like/android/mod.rs +++ b/src/unix/linux_like/android/mod.rs @@ -985,25 +985,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") @@ -1013,14 +994,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 d8aeeefc4df5..ea24eb2b154e 100644 --- a/src/unix/linux_like/linux/mod.rs +++ b/src/unix/linux_like/linux/mod.rs @@ -1740,13 +1740,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], @@ -1768,7 +1766,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, @@ -2101,25 +2098,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") @@ -2128,15 +2106,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") @@ -2210,31 +2179,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") @@ -2245,14 +2189,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") @@ -5788,7 +5724,8 @@ pub const XDP_UMEM_PGOFF_FILL_RING: crate::c_ulonglong = 0x100000000; pub const XDP_UMEM_PGOFF_COMPLETION_RING: crate::c_ulonglong = 0x180000000; pub const XSK_UNALIGNED_BUF_OFFSET_SHIFT: crate::c_int = 48; -pub const XSK_UNALIGNED_BUF_ADDR_MASK: crate::c_ulonglong = (1 << XSK_UNALIGNED_BUF_OFFSET_SHIFT) - 1; +pub const XSK_UNALIGNED_BUF_ADDR_MASK: crate::c_ulonglong = + (1 << XSK_UNALIGNED_BUF_OFFSET_SHIFT) - 1; pub const XDP_PKT_CONTD: crate::__u32 = 1 << 0; 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/linux_like/mod.rs b/src/unix/linux_like/mod.rs index 8f6f3db5aed0..b856ed5cd358 100644 --- a/src/unix/linux_like/mod.rs +++ b/src/unix/linux_like/mod.rs @@ -268,8 +268,6 @@ s_no_extra_traits! { pub u64: u64, } - // Can't correctly impl Debug for unions - #[allow(missing_debug_implementations)] pub union __c_anonymous_sigev_un { _pad: [c_int; SIGEV_PAD_SIZE], pub _tid: c_int, 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 70e549a1b5d8..9fce13226afc 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 44fbc6fcdc49..e1cddc385f28 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 d90957642c0d..876881717147 100644 --- a/src/vxworks/mod.rs +++ b/src/vxworks/mod.rs @@ -533,18 +533,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 { @@ -563,13 +551,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) };