482
482
}
483
483
484
484
s_no_extra_traits ! {
485
- // FIXME: https://github.com/rust-lang/libc/issues/1243
486
- #[ allow( missing_debug_implementations) ]
487
485
#[ cfg_attr( libc_packedN, repr( packed( 4 ) ) ) ]
488
486
pub struct kevent {
489
487
pub ident: :: uintptr_t,
@@ -494,8 +492,6 @@ s_no_extra_traits!{
494
492
pub udata: * mut :: c_void,
495
493
}
496
494
497
- // FIXME: https://github.com/rust-lang/libc/issues/1243
498
- #[ allow( missing_debug_implementations) ]
499
495
#[ cfg_attr( libc_packedN, repr( packed( 4 ) ) ) ]
500
496
pub struct semid_ds {
501
497
// Note the manpage shows different types than the system header.
@@ -509,8 +505,6 @@ s_no_extra_traits!{
509
505
pub sem_pad3: [ :: int32_t; 4 ] ,
510
506
}
511
507
512
- // FIXME: https://github.com/rust-lang/libc/issues/1243
513
- #[ allow( missing_debug_implementations) ]
514
508
#[ cfg_attr( libc_packedN, repr( packed( 4 ) ) ) ]
515
509
pub struct shmid_ds {
516
510
pub shm_perm: ipc_perm,
@@ -640,6 +634,133 @@ cfg_if! {
640
634
641
635
cfg_if ! {
642
636
if #[ cfg( feature = "extra_traits" ) ] {
637
+ impl PartialEq for kevent {
638
+ fn eq( & self , other: & kevent) -> bool {
639
+ self . ident == other. ident
640
+ && self . filter == other. filter
641
+ && self . flags == other. flags
642
+ && self . fflags == other. fflags
643
+ && self . data == other. data
644
+ && self . udata == other. udata
645
+ }
646
+ }
647
+ impl Eq for kevent { }
648
+ impl :: fmt:: Debug for kevent {
649
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
650
+ f. debug_struct( "kevent" )
651
+ . field( "ident" , unsafe { & self . ident } )
652
+ . field( "filter" , unsafe { & self . filter } )
653
+ . field( "flags" , unsafe { & self . flags } )
654
+ . field( "fflags" , unsafe { & self . fflags } )
655
+ . field( "data" , unsafe { & self . data } )
656
+ . field( "udata" , unsafe { & self . udata } )
657
+ . finish( )
658
+ }
659
+ }
660
+ impl :: hash:: Hash for kevent {
661
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
662
+ unsafe {
663
+ self . ident. hash( state) ;
664
+ self . filter. hash( state) ;
665
+ self . flags. hash( state) ;
666
+ self . fflags. hash( state) ;
667
+ self . data. hash( state) ;
668
+ self . udata. hash( state) ;
669
+ }
670
+ }
671
+ }
672
+
673
+ impl PartialEq for semid_ds {
674
+ fn eq( & self , other: & semid_ds) -> bool {
675
+ unsafe {
676
+ self . sem_perm == other. sem_perm
677
+ && self . sem_base == other. sem_base
678
+ && self . sem_nsems == other. sem_nsems
679
+ && self . sem_otime == other. sem_otime
680
+ && self . sem_pad1 == other. sem_pad1
681
+ && self . sem_ctime == other. sem_ctime
682
+ && self . sem_pad2 == other. sem_pad2
683
+ && self . sem_pad3 == other. sem_pad3
684
+ }
685
+ }
686
+ }
687
+ impl Eq for semid_ds { }
688
+ impl :: fmt:: Debug for semid_ds {
689
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
690
+ f. debug_struct( "semid_ds" )
691
+ . field( "sem_perm" , unsafe { & self . sem_perm } )
692
+ . field( "sem_base" , unsafe { & self . sem_base } )
693
+ . field( "sem_nsems" , unsafe { & self . sem_nsems } )
694
+ . field( "sem_otime" , unsafe { & self . sem_otime } )
695
+ . field( "sem_pad1" , unsafe { & self . sem_pad1 } )
696
+ . field( "sem_ctime" , unsafe { & self . sem_ctime } )
697
+ . field( "sem_pad2" , unsafe { & self . sem_pad2 } )
698
+ . field( "sem_pad3" , unsafe { & self . sem_pad3 } )
699
+ . finish( )
700
+ }
701
+ }
702
+ impl :: hash:: Hash for semid_ds {
703
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
704
+ unsafe {
705
+ self . sem_perm. hash( state) ;
706
+ self . sem_base. hash( state) ;
707
+ self . sem_nsems. hash( state) ;
708
+ self . sem_otime. hash( state) ;
709
+ self . sem_pad1. hash( state) ;
710
+ self . sem_ctime. hash( state) ;
711
+ self . sem_pad2. hash( state) ;
712
+ self . sem_pad3. hash( state) ;
713
+ }
714
+ }
715
+ }
716
+
717
+ impl PartialEq for shmid_ds {
718
+ fn eq( & self , other: & shmid_ds) -> bool {
719
+ unsafe {
720
+ self . shm_perm == other. shm_perm
721
+ && self . shm_segsz == other. shm_segsz
722
+ && self . shm_lpid == other. shm_lpid
723
+ && self . shm_cpid == other. shm_cpid
724
+ && self . shm_nattch == other. shm_nattch
725
+ && self . shm_atime == other. shm_atime
726
+ && self . shm_dtime == other. shm_dtime
727
+ && self . shm_ctime == other. shm_ctime
728
+ && self . shm_internal == other. shm_internal
729
+ }
730
+ }
731
+ }
732
+ impl Eq for shmid_ds { }
733
+ impl :: fmt:: Debug for shmid_ds {
734
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
735
+ f. debug_struct( "shmid_ds" )
736
+ . field( "shm_perm" , unsafe { & self . shm_perm } )
737
+ . field( "shm_segsz" , unsafe { & self . shm_segsz } )
738
+ . field( "shm_lpid" , unsafe { & self . shm_lpid } )
739
+ . field( "shm_cpid" , unsafe { & self . shm_cpid } )
740
+ . field( "shm_nattch" , unsafe { & self . shm_nattch } )
741
+ . field( "shm_atime" , unsafe { & self . shm_atime } )
742
+ . field( "shm_dtime" , unsafe { & self . shm_dtime } )
743
+ . field( "shm_ctime" , unsafe { & self . shm_ctime } )
744
+ . field( "shm_internal" , unsafe { & self . shm_internal } )
745
+ . finish( )
746
+ }
747
+ }
748
+ impl :: hash:: Hash for shmid_ds {
749
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
750
+ unsafe {
751
+ self . shm_perm. hash( state) ;
752
+ self . shm_segsz. hash( state) ;
753
+ self . shm_lpid. hash( state) ;
754
+ self . shm_cpid. hash( state) ;
755
+ self . shm_nattch. hash( state) ;
756
+ self . shm_atime. hash( state) ;
757
+ self . shm_dtime. hash( state) ;
758
+ self . shm_ctime. hash( state) ;
759
+ self . shm_internal. hash( state) ;
760
+ }
761
+ }
762
+ }
763
+
643
764
impl PartialEq for proc_threadinfo {
644
765
fn eq( & self , other: & proc_threadinfo) -> bool {
645
766
self . pth_user_time == other. pth_user_time
@@ -676,7 +797,6 @@ cfg_if! {
676
797
. finish( )
677
798
}
678
799
}
679
-
680
800
impl :: hash:: Hash for proc_threadinfo {
681
801
fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
682
802
self . pth_user_time. hash( state) ;
0 commit comments