@@ -32,7 +32,6 @@ macro_rules! expand_align {
32
32
}
33
33
34
34
s_no_extra_traits! {
35
- #[ allow( missing_debug_implementations) ]
36
35
#[ cfg_attr( all( target_pointer_width = "32" ,
37
36
any( target_arch = "arm" ,
38
37
target_arch = "x86_64" ) ) ,
@@ -45,7 +44,6 @@ macro_rules! expand_align {
45
44
size: [ u8 ; :: __SIZEOF_PTHREAD_MUTEX_T] ,
46
45
}
47
46
48
- #[ allow( missing_debug_implementations) ]
49
47
#[ cfg_attr( all( target_pointer_width = "32" ,
50
48
any( target_arch = "arm" ,
51
49
target_arch = "x86_64" ) ) ,
@@ -58,7 +56,6 @@ macro_rules! expand_align {
58
56
size: [ u8 ; :: __SIZEOF_PTHREAD_RWLOCK_T] ,
59
57
}
60
58
61
- #[ allow( missing_debug_implementations) ]
62
59
#[ cfg_attr( target_pointer_width = "32" ,
63
60
repr( align( 4 ) ) ) ]
64
61
#[ cfg_attr( target_pointer_width = "64" ,
@@ -71,5 +68,74 @@ macro_rules! expand_align {
71
68
size: [ u8 ; :: __SIZEOF_PTHREAD_COND_T] ,
72
69
}
73
70
}
71
+
72
+ cfg_if! {
73
+ if #[ cfg( feature = "extra_traits" ) ] {
74
+ impl PartialEq for pthread_cond_t {
75
+ fn eq( & self , other: & pthread_cond_t) -> bool {
76
+ self . size
77
+ . iter( )
78
+ . zip( other. size. iter( ) )
79
+ . all( |( a, b) | a == b)
80
+ }
81
+ }
82
+ impl Eq for pthread_cond_t { }
83
+ impl :: fmt:: Debug for pthread_cond_t {
84
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
85
+ // FIXME: .field("size", &self.size)
86
+ . finish( )
87
+ }
88
+ }
89
+ impl :: hash:: Hash for pthread_cond_t {
90
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
91
+ self . size. hash( state) ;
92
+ }
93
+ }
94
+
95
+ impl PartialEq for pthread_mutex_t {
96
+ fn eq( & self , other: & pthread_mutex_t) -> bool {
97
+ self . size
98
+ . iter( )
99
+ . zip( other. size. iter( ) )
100
+ . all( |( a, b) | a == b)
101
+ }
102
+ }
103
+ impl Eq for pthread_mutex_t { }
104
+ impl :: fmt:: Debug for pthread_mutex_t {
105
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
106
+ f. debug_struct( "pthread_mutex_t" )
107
+ // FIXME: .field("size", &self.size)
108
+ . finish( )
109
+ }
110
+ }
111
+ impl :: hash:: Hash for pthread_mutex_t {
112
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
113
+ self . size. hash( state) ;
114
+ }
115
+ }
116
+
117
+ impl PartialEq for pthread_rwlock_t {
118
+ fn eq( & self , other: & pthread_rwlock_t) -> bool {
119
+ self . size
120
+ . iter( )
121
+ . zip( other. size. iter( ) )
122
+ . all( |( a, b) | a == b)
123
+ }
124
+ }
125
+ impl Eq for pthread_rwlock_t { }
126
+ impl :: fmt:: Debug for pthread_rwlock_t {
127
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
128
+ f. debug_struct( "pthread_rwlock_t" )
129
+ // FIXME: .field("size", &self.size)
130
+ . finish( )
131
+ }
132
+ }
133
+ impl :: hash:: Hash for pthread_rwlock_t {
134
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
135
+ self . size. hash( state) ;
136
+ }
137
+ }
138
+ }
139
+ }
74
140
}
75
141
}
0 commit comments