@@ -1694,6 +1694,32 @@ cfg_if! {
1694
1694
1695
1695
cfg_if ! {
1696
1696
if #[ cfg( feature = "extra_traits" ) ] {
1697
+ impl PartialEq for ifconf
1698
+ where
1699
+ Self : Copy
1700
+ {
1701
+ fn eq( & self , other: & Self ) -> bool {
1702
+ let len_ptr1 = core:: ptr:: addr_of!( self . ifc_len) ;
1703
+ let len_ptr2 = core:: ptr:: addr_of!( other. ifc_len) ;
1704
+ let ifcu_ptr1 = core:: ptr:: addr_of!( self . ifc_ifcu) ;
1705
+ let ifcu_ptr2 = core:: ptr:: addr_of!( other. ifc_ifcu) ;
1706
+
1707
+ // SAFETY: `ifconf` implements `Copy` so the reads are valid
1708
+ let len1 = unsafe { len_ptr1. read_unaligned( ) } ;
1709
+ let len2 = unsafe { len_ptr2. read_unaligned( ) } ;
1710
+ let ifcu1 = unsafe { ifcu_ptr1. read_unaligned( ) } ;
1711
+ let ifcu2 = unsafe { ifcu_ptr2. read_unaligned( ) } ;
1712
+
1713
+ len1 == len2 && ifcu1 == ifcu2
1714
+ }
1715
+ }
1716
+ impl Eq for ifconf { }
1717
+ impl :: fmt:: Debug for ifconf {
1718
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
1719
+ f. debug_struct( "ifconf" ) . finish_non_exhaustive( )
1720
+ }
1721
+ }
1722
+
1697
1723
impl PartialEq for kevent {
1698
1724
fn eq( & self , other: & kevent) -> bool {
1699
1725
self . ident == other. ident
@@ -1704,6 +1730,7 @@ cfg_if! {
1704
1730
&& self . udata == other. udata
1705
1731
}
1706
1732
}
1733
+
1707
1734
impl Eq for kevent { }
1708
1735
impl fmt:: Debug for kevent {
1709
1736
fn fmt( & self , f: & mut fmt:: Formatter ) -> fmt:: Result {
0 commit comments