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,123 @@ 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" , & self . ident)
652
+ . field( "filter" , & self . filter)
653
+ . field( "flags" , & self . flags)
654
+ . field( "fflags" , & self . fflags)
655
+ . field( "data" , & self . data)
656
+ . field( "udata" , & self . udata)
657
+ . finish( )
658
+ }
659
+ }
660
+ impl :: hash:: Hash for kevent {
661
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
662
+ self . ident. hash( state) ;
663
+ self . filter. hash( state) ;
664
+ self . flags. hash( state) ;
665
+ self . fflags. hash( state) ;
666
+ self . data. hash( state) ;
667
+ self . udata. hash( state) ;
668
+ }
669
+ }
670
+
671
+ impl PartialEq for semid_ds {
672
+ fn eq( & self , other: & semid_ds) -> bool {
673
+ self . sem_perm == other. sem_perm
674
+ && self . sem_base == other. sem_base
675
+ && self . sem_nsems == other. sem_nsems
676
+ && self . sem_otime == other. sem_otime
677
+ && self . sem_pad1 == other. sem_pad1
678
+ && self . sem_ctime == other. sem_ctime
679
+ && self . sem_pad2 == other. sem_pad2
680
+ && self . sem_pad3 == other. sem_pad3
681
+ }
682
+ }
683
+ impl Eq for semid_ds { }
684
+ impl :: fmt:: Debug for semid_ds {
685
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
686
+ f. debug_struct( "semid_ds" )
687
+ . field( "sem_perm" , & self . sem_perm)
688
+ . field( "sem_base" , & self . sem_base)
689
+ . field( "sem_nsems" , & self . sem_nsems)
690
+ . field( "sem_otime" , & self . sem_otime)
691
+ . field( "sem_pad1" , & self . sem_pad1)
692
+ . field( "sem_ctime" , & self . sem_ctime)
693
+ . field( "sem_pad2" , & self . sem_pad2)
694
+ . field( "sem_pad3" , & self . sem_pad3)
695
+ . finish( )
696
+ }
697
+ }
698
+ impl :: hash:: Hash for semid_ds {
699
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
700
+ self . sem_perm. hash( state) ;
701
+ self . sem_base. hash( state) ;
702
+ self . sem_nsems. hash( state) ;
703
+ self . sem_otime. hash( state) ;
704
+ self . sem_pad1. hash( state) ;
705
+ self . sem_ctime. hash( state) ;
706
+ self . sem_pad2. hash( state) ;
707
+ self . sem_pad3. hash( state) ;
708
+ }
709
+ }
710
+
711
+ impl PartialEq for shmid_ds {
712
+ fn eq( & self , other: & shmid_ds) -> bool {
713
+ self . shm_perm == other. shm_perm
714
+ && self . shm_segsz == other. shm_segsz
715
+ && self . shm_lpid == other. shm_lpid
716
+ && self . shm_cpid == other. shm_cpid
717
+ && self . shm_nattch == other. shm_nattch
718
+ && self . shm_atime == other. shm_atime
719
+ && self . shm_dtime == other. shm_dtime
720
+ && self . shm_ctime == other. shm_ctime
721
+ && self . shm_internal == other. shm_internal
722
+ }
723
+ }
724
+ impl Eq for shmid_ds { }
725
+ impl :: fmt:: Debug for shmid_ds {
726
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
727
+ f. debug_struct( "shmid_ds" )
728
+ . field( "shm_perm" , & self . shm_perm)
729
+ . field( "shm_segsz" , & self . shm_segsz)
730
+ . field( "shm_lpid" , & self . shm_lpid)
731
+ . field( "shm_cpid" , & self . shm_cpid)
732
+ . field( "shm_nattch" , & self . shm_nattch)
733
+ . field( "shm_atime" , & self . shm_atime)
734
+ . field( "shm_dtime" , & self . shm_dtime)
735
+ . field( "shm_ctime" , & self . shm_ctime)
736
+ . field( "shm_internal" , & self . shm_internal)
737
+ . finish( )
738
+ }
739
+ }
740
+ impl :: hash:: Hash for shmid_ds {
741
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
742
+ self . shm_perm. hash( state) ;
743
+ self . shm_segsz. hash( state) ;
744
+ self . shm_lpid. hash( state) ;
745
+ self . shm_cpid. hash( state) ;
746
+ self . shm_nattch. hash( state) ;
747
+ self . shm_atime. hash( state) ;
748
+ self . shm_dtime. hash( state) ;
749
+ self . shm_ctime. hash( state) ;
750
+ self . shm_internal. hash( state) ;
751
+ }
752
+ }
753
+
643
754
impl PartialEq for proc_threadinfo {
644
755
fn eq( & self , other: & proc_threadinfo) -> bool {
645
756
self . pth_user_time == other. pth_user_time
@@ -676,7 +787,6 @@ cfg_if! {
676
787
. finish( )
677
788
}
678
789
}
679
-
680
790
impl :: hash:: Hash for proc_threadinfo {
681
791
fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
682
792
self . pth_user_time. hash( state) ;
0 commit comments