@@ -6,19 +6,15 @@ use crate::hir::map::DefPathHash;
6
6
use crate :: hir:: def_id:: { DefId , LocalDefId , CrateNum , CRATE_DEF_INDEX } ;
7
7
use crate :: ich:: { StableHashingContext , NodeIdHashingMode , Fingerprint } ;
8
8
9
- use rustc_data_structures:: stable_hasher:: {
10
- HashStable , ToStableHashKey , StableHasher , StableHasherResult ,
11
- } ;
9
+ use rustc_data_structures:: stable_hasher:: { HashStable , ToStableHashKey , StableHasher } ;
12
10
use smallvec:: SmallVec ;
13
11
use std:: mem;
14
12
use syntax:: ast;
15
13
use syntax:: attr;
16
14
17
15
impl < ' a > HashStable < StableHashingContext < ' a > > for DefId {
18
16
#[ inline]
19
- fn hash_stable < W : StableHasherResult > ( & self ,
20
- hcx : & mut StableHashingContext < ' a > ,
21
- hasher : & mut StableHasher < W > ) {
17
+ fn hash_stable ( & self , hcx : & mut StableHashingContext < ' a > , hasher : & mut StableHasher ) {
22
18
hcx. def_path_hash ( * self ) . hash_stable ( hcx, hasher) ;
23
19
}
24
20
}
@@ -34,9 +30,7 @@ impl<'a> ToStableHashKey<StableHashingContext<'a>> for DefId {
34
30
35
31
impl < ' a > HashStable < StableHashingContext < ' a > > for LocalDefId {
36
32
#[ inline]
37
- fn hash_stable < W : StableHasherResult > ( & self ,
38
- hcx : & mut StableHashingContext < ' a > ,
39
- hasher : & mut StableHasher < W > ) {
33
+ fn hash_stable ( & self , hcx : & mut StableHashingContext < ' a > , hasher : & mut StableHasher ) {
40
34
hcx. def_path_hash ( self . to_def_id ( ) ) . hash_stable ( hcx, hasher) ;
41
35
}
42
36
}
@@ -52,9 +46,7 @@ impl<'a> ToStableHashKey<StableHashingContext<'a>> for LocalDefId {
52
46
53
47
impl < ' a > HashStable < StableHashingContext < ' a > > for CrateNum {
54
48
#[ inline]
55
- fn hash_stable < W : StableHasherResult > ( & self ,
56
- hcx : & mut StableHashingContext < ' a > ,
57
- hasher : & mut StableHasher < W > ) {
49
+ fn hash_stable ( & self , hcx : & mut StableHashingContext < ' a > , hasher : & mut StableHasher ) {
58
50
hcx. def_path_hash ( DefId {
59
51
krate : * self ,
60
52
index : CRATE_DEF_INDEX
@@ -92,9 +84,7 @@ for hir::ItemLocalId {
92
84
// in "DefPath Mode".
93
85
94
86
impl < ' a > HashStable < StableHashingContext < ' a > > for hir:: ItemId {
95
- fn hash_stable < W : StableHasherResult > ( & self ,
96
- hcx : & mut StableHashingContext < ' a > ,
97
- hasher : & mut StableHasher < W > ) {
87
+ fn hash_stable ( & self , hcx : & mut StableHashingContext < ' a > , hasher : & mut StableHasher ) {
98
88
let hir:: ItemId {
99
89
id
100
90
} = * self ;
@@ -106,9 +96,7 @@ impl<'a> HashStable<StableHashingContext<'a>> for hir::ItemId {
106
96
}
107
97
108
98
impl < ' a > HashStable < StableHashingContext < ' a > > for hir:: TraitItemId {
109
- fn hash_stable < W : StableHasherResult > ( & self ,
110
- hcx : & mut StableHashingContext < ' a > ,
111
- hasher : & mut StableHasher < W > ) {
99
+ fn hash_stable ( & self , hcx : & mut StableHashingContext < ' a > , hasher : & mut StableHasher ) {
112
100
let hir:: TraitItemId {
113
101
hir_id
114
102
} = * self ;
@@ -120,9 +108,7 @@ impl<'a> HashStable<StableHashingContext<'a>> for hir::TraitItemId {
120
108
}
121
109
122
110
impl < ' a > HashStable < StableHashingContext < ' a > > for hir:: ImplItemId {
123
- fn hash_stable < W : StableHasherResult > ( & self ,
124
- hcx : & mut StableHashingContext < ' a > ,
125
- hasher : & mut StableHasher < W > ) {
111
+ fn hash_stable ( & self , hcx : & mut StableHashingContext < ' a > , hasher : & mut StableHasher ) {
126
112
let hir:: ImplItemId {
127
113
hir_id
128
114
} = * self ;
@@ -138,9 +124,7 @@ impl_stable_hash_for!(struct ast::Label {
138
124
} ) ;
139
125
140
126
impl < ' a > HashStable < StableHashingContext < ' a > > for hir:: Ty {
141
- fn hash_stable < W : StableHasherResult > ( & self ,
142
- hcx : & mut StableHashingContext < ' a > ,
143
- hasher : & mut StableHasher < W > ) {
127
+ fn hash_stable ( & self , hcx : & mut StableHashingContext < ' a > , hasher : & mut StableHasher ) {
144
128
hcx. while_hashing_hir_bodies ( true , |hcx| {
145
129
let hir:: Ty {
146
130
hir_id : _,
@@ -166,9 +150,7 @@ impl_stable_hash_for!(struct hir::Stmt {
166
150
impl_stable_hash_for_spanned ! ( ast:: Name ) ;
167
151
168
152
impl < ' a > HashStable < StableHashingContext < ' a > > for hir:: Expr {
169
- fn hash_stable < W : StableHasherResult > ( & self ,
170
- hcx : & mut StableHashingContext < ' a > ,
171
- hasher : & mut StableHasher < W > ) {
153
+ fn hash_stable ( & self , hcx : & mut StableHashingContext < ' a > , hasher : & mut StableHasher ) {
172
154
hcx. while_hashing_hir_bodies ( true , |hcx| {
173
155
let hir:: Expr {
174
156
hir_id : _,
@@ -192,9 +174,7 @@ impl_stable_hash_for!(struct ast::Ident {
192
174
} ) ;
193
175
194
176
impl < ' a > HashStable < StableHashingContext < ' a > > for hir:: TraitItem {
195
- fn hash_stable < W : StableHasherResult > ( & self ,
196
- hcx : & mut StableHashingContext < ' a > ,
197
- hasher : & mut StableHasher < W > ) {
177
+ fn hash_stable ( & self , hcx : & mut StableHashingContext < ' a > , hasher : & mut StableHasher ) {
198
178
let hir:: TraitItem {
199
179
hir_id : _,
200
180
ident,
@@ -216,9 +196,7 @@ impl<'a> HashStable<StableHashingContext<'a>> for hir::TraitItem {
216
196
217
197
218
198
impl < ' a > HashStable < StableHashingContext < ' a > > for hir:: ImplItem {
219
- fn hash_stable < W : StableHasherResult > ( & self ,
220
- hcx : & mut StableHashingContext < ' a > ,
221
- hasher : & mut StableHasher < W > ) {
199
+ fn hash_stable ( & self , hcx : & mut StableHashingContext < ' a > , hasher : & mut StableHasher ) {
222
200
let hir:: ImplItem {
223
201
hir_id : _,
224
202
ident,
@@ -248,9 +226,7 @@ impl_stable_hash_for!(enum ast::CrateSugar {
248
226
} ) ;
249
227
250
228
impl < ' a > HashStable < StableHashingContext < ' a > > for hir:: VisibilityKind {
251
- fn hash_stable < W : StableHasherResult > ( & self ,
252
- hcx : & mut StableHashingContext < ' a > ,
253
- hasher : & mut StableHasher < W > ) {
229
+ fn hash_stable ( & self , hcx : & mut StableHashingContext < ' a > , hasher : & mut StableHasher ) {
254
230
mem:: discriminant ( self ) . hash_stable ( hcx, hasher) ;
255
231
match * self {
256
232
hir:: VisibilityKind :: Public |
@@ -273,9 +249,7 @@ impl<'a> HashStable<StableHashingContext<'a>> for hir::VisibilityKind {
273
249
impl_stable_hash_for_spanned ! ( hir:: VisibilityKind ) ;
274
250
275
251
impl < ' a > HashStable < StableHashingContext < ' a > > for hir:: Mod {
276
- fn hash_stable < W : StableHasherResult > ( & self ,
277
- hcx : & mut StableHashingContext < ' a > ,
278
- hasher : & mut StableHasher < W > ) {
252
+ fn hash_stable ( & self , hcx : & mut StableHashingContext < ' a > , hasher : & mut StableHasher ) {
279
253
let hir:: Mod {
280
254
inner : ref inner_span,
281
255
ref item_ids,
@@ -305,9 +279,7 @@ impl_stable_hash_for_spanned!(hir::Variant);
305
279
306
280
307
281
impl < ' a > HashStable < StableHashingContext < ' a > > for hir:: Item {
308
- fn hash_stable < W : StableHasherResult > ( & self ,
309
- hcx : & mut StableHashingContext < ' a > ,
310
- hasher : & mut StableHasher < W > ) {
282
+ fn hash_stable ( & self , hcx : & mut StableHashingContext < ' a > , hasher : & mut StableHasher ) {
311
283
let hir:: Item {
312
284
ident,
313
285
ref attrs,
@@ -328,9 +300,7 @@ impl<'a> HashStable<StableHashingContext<'a>> for hir::Item {
328
300
}
329
301
330
302
impl < ' a > HashStable < StableHashingContext < ' a > > for hir:: Body {
331
- fn hash_stable < W : StableHasherResult > ( & self ,
332
- hcx : & mut StableHashingContext < ' a > ,
333
- hasher : & mut StableHasher < W > ) {
303
+ fn hash_stable ( & self , hcx : & mut StableHashingContext < ' a > , hasher : & mut StableHasher ) {
334
304
let hir:: Body {
335
305
params,
336
306
value,
@@ -359,9 +329,7 @@ impl<'a> ToStableHashKey<StableHashingContext<'a>> for hir::BodyId {
359
329
360
330
impl < ' a > HashStable < StableHashingContext < ' a > > for hir:: def_id:: DefIndex {
361
331
362
- fn hash_stable < W : StableHasherResult > ( & self ,
363
- hcx : & mut StableHashingContext < ' a > ,
364
- hasher : & mut StableHasher < W > ) {
332
+ fn hash_stable ( & self , hcx : & mut StableHashingContext < ' a > , hasher : & mut StableHasher ) {
365
333
hcx. local_def_path_hash ( * self ) . hash_stable ( hcx, hasher) ;
366
334
}
367
335
}
@@ -376,17 +344,13 @@ impl<'a> ToStableHashKey<StableHashingContext<'a>> for hir::def_id::DefIndex {
376
344
}
377
345
378
346
impl < ' a > HashStable < StableHashingContext < ' a > > for crate :: middle:: lang_items:: LangItem {
379
- fn hash_stable < W : StableHasherResult > ( & self ,
380
- _: & mut StableHashingContext < ' a > ,
381
- hasher : & mut StableHasher < W > ) {
347
+ fn hash_stable ( & self , _: & mut StableHashingContext < ' a > , hasher : & mut StableHasher ) {
382
348
:: std:: hash:: Hash :: hash ( self , hasher) ;
383
349
}
384
350
}
385
351
386
352
impl < ' a > HashStable < StableHashingContext < ' a > > for hir:: TraitCandidate {
387
- fn hash_stable < W : StableHasherResult > ( & self ,
388
- hcx : & mut StableHashingContext < ' a > ,
389
- hasher : & mut StableHasher < W > ) {
353
+ fn hash_stable ( & self , hcx : & mut StableHashingContext < ' a > , hasher : & mut StableHasher ) {
390
354
hcx. with_node_id_hashing_mode ( NodeIdHashingMode :: HashDefPath , |hcx| {
391
355
let hir:: TraitCandidate {
392
356
def_id,
@@ -418,17 +382,13 @@ impl<'a> ToStableHashKey<StableHashingContext<'a>> for hir::TraitCandidate {
418
382
}
419
383
420
384
impl < ' hir > HashStable < StableHashingContext < ' hir > > for attr:: InlineAttr {
421
- fn hash_stable < W : StableHasherResult > ( & self ,
422
- hcx : & mut StableHashingContext < ' hir > ,
423
- hasher : & mut StableHasher < W > ) {
385
+ fn hash_stable ( & self , hcx : & mut StableHashingContext < ' hir > , hasher : & mut StableHasher ) {
424
386
mem:: discriminant ( self ) . hash_stable ( hcx, hasher) ;
425
387
}
426
388
}
427
389
428
390
impl < ' hir > HashStable < StableHashingContext < ' hir > > for attr:: OptimizeAttr {
429
- fn hash_stable < W : StableHasherResult > ( & self ,
430
- hcx : & mut StableHashingContext < ' hir > ,
431
- hasher : & mut StableHasher < W > ) {
391
+ fn hash_stable ( & self , hcx : & mut StableHashingContext < ' hir > , hasher : & mut StableHasher ) {
432
392
mem:: discriminant ( self ) . hash_stable ( hcx, hasher) ;
433
393
}
434
394
}
0 commit comments