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,175 @@ 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
+ let ident = self . ident;
651
+ let filter = self . filter;
652
+ let flags = self . flags;
653
+ let fflags = self . fflags;
654
+ let data = self . data;
655
+ let udata = self . udata;
656
+ f. debug_struct( "kevent" )
657
+ . field( "ident" , & ident)
658
+ . field( "filter" , & filter)
659
+ . field( "flags" , & flags)
660
+ . field( "fflags" , & fflags)
661
+ . field( "data" , & data)
662
+ . field( "udata" , & udata)
663
+ . finish( )
664
+ }
665
+ }
666
+ impl :: hash:: Hash for kevent {
667
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
668
+ let ident = self . ident;
669
+ let filter = self . filter;
670
+ let flags = self . flags;
671
+ let fflags = self . fflags;
672
+ let data = self . data;
673
+ let udata = self . udata;
674
+ ident. hash( state) ;
675
+ filter. hash( state) ;
676
+ flags. hash( state) ;
677
+ fflags. hash( state) ;
678
+ data. hash( state) ;
679
+ udata. hash( state) ;
680
+ }
681
+ }
682
+
683
+ impl PartialEq for semid_ds {
684
+ fn eq( & self , other: & semid_ds) -> bool {
685
+ let sem_perm = self . sem_perm;
686
+ let sem_pad3 = self . sem_pad3;
687
+ let other_sem_perm = other. sem_perm;
688
+ let other_sem_pad3 = other. sem_pad3;
689
+ sem_perm == other_sem_perm
690
+ && self . sem_base == other. sem_base
691
+ && self . sem_nsems == other. sem_nsems
692
+ && self . sem_otime == other. sem_otime
693
+ && self . sem_pad1 == other. sem_pad1
694
+ && self . sem_ctime == other. sem_ctime
695
+ && self . sem_pad2 == other. sem_pad2
696
+ && sem_pad3 == other_sem_pad3
697
+ }
698
+ }
699
+ impl Eq for semid_ds { }
700
+ impl :: fmt:: Debug for semid_ds {
701
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
702
+ let sem_perm = self . sem_perm;
703
+ let sem_base = self . sem_base;
704
+ let sem_nsems = self . sem_nsems;
705
+ let sem_otime = self . sem_otime;
706
+ let sem_pad1 = self . sem_pad1;
707
+ let sem_ctime = self . sem_ctime;
708
+ let sem_pad2 = self . sem_pad2;
709
+ let sem_pad3 = self . sem_pad3;
710
+ f. debug_struct( "semid_ds" )
711
+ . field( "sem_perm" , & sem_perm)
712
+ . field( "sem_base" , & sem_base)
713
+ . field( "sem_nsems" , & sem_nsems)
714
+ . field( "sem_otime" , & sem_otime)
715
+ . field( "sem_pad1" , & sem_pad1)
716
+ . field( "sem_ctime" , & sem_ctime)
717
+ . field( "sem_pad2" , & sem_pad2)
718
+ . field( "sem_pad3" , & sem_pad3)
719
+ . finish( )
720
+ }
721
+ }
722
+ impl :: hash:: Hash for semid_ds {
723
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
724
+ let sem_perm = self . sem_perm;
725
+ let sem_base = self . sem_base;
726
+ let sem_nsems = self . sem_nsems;
727
+ let sem_otime = self . sem_otime;
728
+ let sem_pad1 = self . sem_pad1;
729
+ let sem_ctime = self . sem_ctime;
730
+ let sem_pad2 = self . sem_pad2;
731
+ let sem_pad3 = self . sem_pad3;
732
+ sem_perm. hash( state) ;
733
+ sem_base. hash( state) ;
734
+ sem_nsems. hash( state) ;
735
+ sem_otime. hash( state) ;
736
+ sem_pad1. hash( state) ;
737
+ sem_ctime. hash( state) ;
738
+ sem_pad2. hash( state) ;
739
+ sem_pad3. hash( state) ;
740
+ }
741
+ }
742
+
743
+ impl PartialEq for shmid_ds {
744
+ fn eq( & self , other: & shmid_ds) -> bool {
745
+ let shm_perm = self . shm_perm;
746
+ let other_shm_perm = other. shm_perm;
747
+ shm_perm == other_shm_perm
748
+ && self . shm_segsz == other. shm_segsz
749
+ && self . shm_lpid == other. shm_lpid
750
+ && self . shm_cpid == other. shm_cpid
751
+ && self . shm_nattch == other. shm_nattch
752
+ && self . shm_atime == other. shm_atime
753
+ && self . shm_dtime == other. shm_dtime
754
+ && self . shm_ctime == other. shm_ctime
755
+ && self . shm_internal == other. shm_internal
756
+ }
757
+ }
758
+ impl Eq for shmid_ds { }
759
+ impl :: fmt:: Debug for shmid_ds {
760
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
761
+ let shm_perm = self . shm_perm;
762
+ let shm_segsz = self . shm_segsz;
763
+ let shm_lpid = self . shm_lpid;
764
+ let shm_cpid = self . shm_cpid;
765
+ let shm_nattch = self . shm_nattch;
766
+ let shm_atime = self . shm_atime;
767
+ let shm_dtime = self . shm_dtime;
768
+ let shm_ctime = self . shm_ctime;
769
+ let shm_internal = self . shm_internal;
770
+ f. debug_struct( "shmid_ds" )
771
+ . field( "shm_perm" , & shm_perm)
772
+ . field( "shm_segsz" , & shm_segsz)
773
+ . field( "shm_lpid" , & shm_lpid)
774
+ . field( "shm_cpid" , & shm_cpid)
775
+ . field( "shm_nattch" , & shm_nattch)
776
+ . field( "shm_atime" , & shm_atime)
777
+ . field( "shm_dtime" , & shm_dtime)
778
+ . field( "shm_ctime" , & shm_ctime)
779
+ . field( "shm_internal" , & shm_internal)
780
+ . finish( )
781
+ }
782
+ }
783
+ impl :: hash:: Hash for shmid_ds {
784
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
785
+ let shm_perm = self . shm_perm;
786
+ let shm_segsz = self . shm_segsz;
787
+ let shm_lpid = self . shm_lpid;
788
+ let shm_cpid = self . shm_cpid;
789
+ let shm_nattch = self . shm_nattch;
790
+ let shm_atime = self . shm_atime;
791
+ let shm_dtime = self . shm_dtime;
792
+ let shm_ctime = self . shm_ctime;
793
+ let shm_internal = self . shm_internal;
794
+ shm_perm. hash( state) ;
795
+ shm_segsz. hash( state) ;
796
+ shm_lpid. hash( state) ;
797
+ shm_cpid. hash( state) ;
798
+ shm_nattch. hash( state) ;
799
+ shm_atime. hash( state) ;
800
+ shm_dtime. hash( state) ;
801
+ shm_ctime. hash( state) ;
802
+ shm_internal. hash( state) ;
803
+ }
804
+ }
805
+
643
806
impl PartialEq for proc_threadinfo {
644
807
fn eq( & self , other: & proc_threadinfo) -> bool {
645
808
self . pth_user_time == other. pth_user_time
@@ -676,7 +839,6 @@ cfg_if! {
676
839
. finish( )
677
840
}
678
841
}
679
-
680
842
impl :: hash:: Hash for proc_threadinfo {
681
843
fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
682
844
self . pth_user_time. hash( state) ;
0 commit comments