@@ -14,13 +14,18 @@ pub(crate) fn implement(cx: &Ctxt<'_>, en: &DataEnum) -> Result<TokenStream, ()>
14
14
let copy = & cx. toks . copy ;
15
15
let default = & cx. toks . default ;
16
16
let eq = & cx. toks . eq ;
17
+ let hash = & cx. toks . hash ;
18
+ let hasher = & cx. toks . hasher ;
17
19
let into_iter = & cx. toks . into_iter ;
18
20
let iterator = & cx. toks . iterator_t ;
19
21
let iterator_flatten = & cx. toks . iterator_flatten ;
20
22
let key_trait = & cx. toks . key_trait ;
21
23
let mem = & cx. toks . mem ;
22
24
let option = & cx. toks . option ;
23
25
let partial_eq = & cx. toks . partial_eq ;
26
+ let partial_ord = & cx. toks . partial_ord ;
27
+ let ordering = & cx. toks . ordering ;
28
+ let ord = & cx. toks . ord ;
24
29
let slice_iter = & cx. toks . slice_iter ;
25
30
let slice_iter_mut = & cx. toks . slice_iter_mut ;
26
31
let array_into_iter = & cx. toks . array_into_iter ;
@@ -191,16 +196,86 @@ pub(crate) fn implement(cx: &Ctxt<'_>, en: &DataEnum) -> Result<TokenStream, ()>
191
196
}
192
197
193
198
#[ automatically_derived]
194
- impl <V > #partial_eq for Storage <V > where V : #partial_eq{
199
+ impl <V > #partial_eq for Storage <V > where V : #partial_eq {
195
200
#[ inline]
196
201
fn eq( & self , other: & Storage <V >) -> bool {
197
- self . data == other. data
202
+ #partial_eq:: eq( & self . data, & other. data)
203
+ }
204
+
205
+ #[ inline]
206
+ fn ne( & self , other: & Storage <V >) -> bool {
207
+ #partial_eq:: ne( & self . data, & other. data)
198
208
}
199
209
}
200
210
201
211
#[ automatically_derived]
202
212
impl <V > #eq for Storage <V > where V : #eq { }
203
213
214
+ #[ automatically_derived]
215
+ impl <V > #hash for Storage <V > where V : #hash {
216
+ #[ inline]
217
+ fn hash<H >( & self , state: & mut H )
218
+ where
219
+ H : #hasher,
220
+ {
221
+ #hash:: hash( & self . data, state) ;
222
+ }
223
+ }
224
+
225
+ #[ automatically_derived]
226
+ impl <V > #partial_ord for Storage <V > where V : #partial_ord {
227
+ #[ inline]
228
+ fn partial_cmp( & self , other: & Self ) -> Option <#ordering> {
229
+ #partial_ord:: partial_cmp( & self . data, & other. data)
230
+ }
231
+
232
+ #[ inline]
233
+ fn lt( & self , other: & Self ) -> bool {
234
+ #partial_ord:: lt( & self . data, & other. data)
235
+ }
236
+
237
+ #[ inline]
238
+ fn le( & self , other: & Self ) -> bool {
239
+ #partial_ord:: le( & self . data, & other. data)
240
+ }
241
+
242
+ #[ inline]
243
+ fn gt( & self , other: & Self ) -> bool {
244
+ #partial_ord:: gt( & self . data, & other. data)
245
+ }
246
+
247
+ #[ inline]
248
+ fn ge( & self , other: & Self ) -> bool {
249
+ #partial_ord:: ge( & self . data, & other. data)
250
+ }
251
+ }
252
+
253
+ #[ automatically_derived]
254
+ impl <V > #ord for Storage <V > where V : #ord {
255
+ #[ inline]
256
+ fn cmp( & self , other: & Self ) -> #ordering {
257
+ #ord:: cmp( self , other)
258
+ }
259
+
260
+ #[ inline]
261
+ fn max( self , other: Self ) -> Self {
262
+ Self { data: #ord:: max( self . data, other. data) }
263
+ }
264
+
265
+ #[ inline]
266
+ fn min( self , other: Self ) -> Self {
267
+ Self { data: #ord:: min( self . data, other. data) }
268
+ }
269
+
270
+ #[ inline]
271
+ fn clamp( self , min: Self , max: Self ) -> Self
272
+ where
273
+ Self : #partial_ord<Self >
274
+ {
275
+ Self { data: #ord:: clamp( self . data, min. data, max. data) }
276
+ }
277
+ }
278
+
204
279
#[ automatically_derived]
205
280
impl <V > #default for Storage <V > {
206
281
#[ inline]
0 commit comments