@@ -357,20 +357,11 @@ impl_stable_hash_for!(enum hir::FunctionRetTy {
357
357
Return ( t)
358
358
} ) ;
359
359
360
- impl < ' a > HashStable < StableHashingContext < ' a > > for hir:: TraitRef {
361
- fn hash_stable < W : StableHasherResult > ( & self ,
362
- hcx : & mut StableHashingContext < ' a > ,
363
- hasher : & mut StableHasher < W > ) {
364
- let hir:: TraitRef {
365
- ref path,
366
- // Don't hash the ref_id. It is tracked via the thing it is used to access
367
- ref_id : _,
368
- } = * self ;
369
-
370
- path. hash_stable ( hcx, hasher) ;
371
- }
372
- }
373
-
360
+ impl_stable_hash_for ! ( struct hir:: TraitRef {
361
+ // Don't hash the ref_id. It is tracked via the thing it is used to access
362
+ ref_id -> _,
363
+ path,
364
+ } ) ;
374
365
375
366
impl_stable_hash_for ! ( struct hir:: PolyTraitRef {
376
367
bound_generic_params,
@@ -393,66 +384,32 @@ impl_stable_hash_for!(struct hir::MacroDef {
393
384
body
394
385
} ) ;
395
386
387
+ impl_stable_hash_for ! ( struct hir:: Block {
388
+ stmts,
389
+ expr,
390
+ id -> _,
391
+ hir_id -> _,
392
+ rules,
393
+ span,
394
+ targeted_by_break,
395
+ recovered,
396
+ } ) ;
396
397
397
- impl < ' a > HashStable < StableHashingContext < ' a > > for hir:: Block {
398
- fn hash_stable < W : StableHasherResult > ( & self ,
399
- hcx : & mut StableHashingContext < ' a > ,
400
- hasher : & mut StableHasher < W > ) {
401
- let hir:: Block {
402
- ref stmts,
403
- ref expr,
404
- id : _,
405
- hir_id : _,
406
- rules,
407
- span,
408
- targeted_by_break,
409
- recovered,
410
- } = * self ;
411
-
412
- stmts. hash_stable ( hcx, hasher) ;
413
- expr. hash_stable ( hcx, hasher) ;
414
- rules. hash_stable ( hcx, hasher) ;
415
- span. hash_stable ( hcx, hasher) ;
416
- recovered. hash_stable ( hcx, hasher) ;
417
- targeted_by_break. hash_stable ( hcx, hasher) ;
418
- }
419
- }
420
-
421
- impl < ' a > HashStable < StableHashingContext < ' a > > for hir:: Pat {
422
- fn hash_stable < W : StableHasherResult > ( & self ,
423
- hcx : & mut StableHashingContext < ' a > ,
424
- hasher : & mut StableHasher < W > ) {
425
- let hir:: Pat {
426
- id : _,
427
- hir_id : _,
428
- ref node,
429
- ref span
430
- } = * self ;
431
-
432
-
433
- node. hash_stable ( hcx, hasher) ;
434
- span. hash_stable ( hcx, hasher) ;
435
- }
436
- }
398
+ impl_stable_hash_for ! ( struct hir:: Pat {
399
+ id -> _,
400
+ hir_id -> _,
401
+ node,
402
+ span,
403
+ } ) ;
437
404
438
405
impl_stable_hash_for_spanned ! ( hir:: FieldPat ) ;
439
406
440
- impl < ' a > HashStable < StableHashingContext < ' a > > for hir:: FieldPat {
441
- fn hash_stable < W : StableHasherResult > ( & self ,
442
- hcx : & mut StableHashingContext < ' a > ,
443
- hasher : & mut StableHasher < W > ) {
444
- let hir:: FieldPat {
445
- id : _,
446
- ident,
447
- ref pat,
448
- is_shorthand,
449
- } = * self ;
450
-
451
- ident. hash_stable ( hcx, hasher) ;
452
- pat. hash_stable ( hcx, hasher) ;
453
- is_shorthand. hash_stable ( hcx, hasher) ;
454
- }
455
- }
407
+ impl_stable_hash_for ! ( struct hir:: FieldPat {
408
+ id -> _,
409
+ ident,
410
+ pat,
411
+ is_shorthand,
412
+ } ) ;
456
413
457
414
impl_stable_hash_for ! ( enum hir:: BindingAnnotation {
458
415
Unannotated ,
@@ -535,24 +492,13 @@ impl_stable_hash_for!(struct hir::Arm {
535
492
body
536
493
} ) ;
537
494
538
- impl < ' a > HashStable < StableHashingContext < ' a > > for hir:: Field {
539
- fn hash_stable < W : StableHasherResult > ( & self ,
540
- hcx : & mut StableHashingContext < ' a > ,
541
- hasher : & mut StableHasher < W > ) {
542
- let hir:: Field {
543
- id : _,
544
- ident,
545
- ref expr,
546
- span,
547
- is_shorthand,
548
- } = * self ;
549
-
550
- ident. hash_stable ( hcx, hasher) ;
551
- expr. hash_stable ( hcx, hasher) ;
552
- span. hash_stable ( hcx, hasher) ;
553
- is_shorthand. hash_stable ( hcx, hasher) ;
554
- }
555
- }
495
+ impl_stable_hash_for ! ( struct hir:: Field {
496
+ id -> _,
497
+ ident,
498
+ expr,
499
+ span,
500
+ is_shorthand,
501
+ } ) ;
556
502
557
503
impl_stable_hash_for_spanned ! ( ast:: Name ) ;
558
504
@@ -684,19 +630,10 @@ impl_stable_hash_for!(enum hir::LoopIdError {
684
630
UnresolvedLabel
685
631
} ) ;
686
632
687
- impl < ' a > HashStable < StableHashingContext < ' a > > for ast:: Ident {
688
- fn hash_stable < W : StableHasherResult > ( & self ,
689
- hcx : & mut StableHashingContext < ' a > ,
690
- hasher : & mut StableHasher < W > ) {
691
- let ast:: Ident {
692
- name,
693
- span,
694
- } = * self ;
695
-
696
- name. hash_stable ( hcx, hasher) ;
697
- span. hash_stable ( hcx, hasher) ;
698
- }
699
- }
633
+ impl_stable_hash_for ! ( struct ast:: Ident {
634
+ name,
635
+ span,
636
+ } ) ;
700
637
701
638
impl < ' a > HashStable < StableHashingContext < ' a > > for hir:: TraitItem {
702
639
fn hash_stable < W : StableHasherResult > ( & self ,
@@ -816,21 +753,13 @@ impl_stable_hash_for!(enum hir::ImplPolarity {
816
753
Negative
817
754
} ) ;
818
755
819
- impl < ' a > HashStable < StableHashingContext < ' a > > for hir:: Mod {
820
- fn hash_stable < W : StableHasherResult > ( & self ,
821
- hcx : & mut StableHashingContext < ' a > ,
822
- hasher : & mut StableHasher < W > ) {
823
- let hir:: Mod {
824
- inner,
825
- // We are not hashing the IDs of the items contained in the module.
826
- // This is harmless and matches the current behavior but it's not
827
- // actually correct. See issue #40876.
828
- item_ids : _,
829
- } = * self ;
830
-
831
- inner. hash_stable ( hcx, hasher) ;
832
- }
833
- }
756
+ impl_stable_hash_for ! ( struct hir:: Mod {
757
+ inner,
758
+ // We are not hashing the IDs of the items contained in the module.
759
+ // This is harmless and matches the current behavior but it's not
760
+ // actually correct. See issue #40876.
761
+ item_ids -> _,
762
+ } ) ;
834
763
835
764
impl_stable_hash_for ! ( struct hir:: ForeignMod {
836
765
abi,
@@ -931,8 +860,7 @@ impl_stable_hash_for!(struct hir::ImplItemRef {
931
860
defaultness
932
861
} ) ;
933
862
934
- impl < ' a > HashStable < StableHashingContext < ' a > >
935
- for hir:: AssociatedItemKind {
863
+ impl < ' a > HashStable < StableHashingContext < ' a > > for hir:: AssociatedItemKind {
936
864
fn hash_stable < W : StableHasherResult > ( & self ,
937
865
hcx : & mut StableHashingContext < ' a > ,
938
866
hasher : & mut StableHasher < W > ) {
@@ -1012,45 +940,22 @@ impl_stable_hash_for!(struct hir::InlineAsmOutput {
1012
940
is_indirect
1013
941
} ) ;
1014
942
1015
- impl < ' a > HashStable < StableHashingContext < ' a > > for hir:: GlobalAsm {
1016
- fn hash_stable < W : StableHasherResult > ( & self ,
1017
- hcx : & mut StableHashingContext < ' a > ,
1018
- hasher : & mut StableHasher < W > ) {
1019
- let hir:: GlobalAsm {
1020
- asm,
1021
- ctxt : _
1022
- } = * self ;
1023
-
1024
- asm. hash_stable ( hcx, hasher) ;
1025
- }
1026
- }
1027
-
1028
- impl < ' a > HashStable < StableHashingContext < ' a > > for hir:: InlineAsm {
1029
- fn hash_stable < W : StableHasherResult > ( & self ,
1030
- hcx : & mut StableHashingContext < ' a > ,
1031
- hasher : & mut StableHasher < W > ) {
1032
- let hir:: InlineAsm {
1033
- asm,
1034
- asm_str_style,
1035
- ref outputs,
1036
- ref inputs,
1037
- ref clobbers,
1038
- volatile,
1039
- alignstack,
1040
- dialect,
1041
- ctxt : _, // This is used for error reporting
1042
- } = * self ;
943
+ impl_stable_hash_for ! ( struct hir:: GlobalAsm {
944
+ asm,
945
+ ctxt -> _, // This is used for error reporting
946
+ } ) ;
1043
947
1044
- asm. hash_stable ( hcx, hasher) ;
1045
- asm_str_style. hash_stable ( hcx, hasher) ;
1046
- outputs. hash_stable ( hcx, hasher) ;
1047
- inputs. hash_stable ( hcx, hasher) ;
1048
- clobbers. hash_stable ( hcx, hasher) ;
1049
- volatile. hash_stable ( hcx, hasher) ;
1050
- alignstack. hash_stable ( hcx, hasher) ;
1051
- dialect. hash_stable ( hcx, hasher) ;
1052
- }
1053
- }
948
+ impl_stable_hash_for ! ( struct hir:: InlineAsm {
949
+ asm,
950
+ asm_str_style,
951
+ outputs,
952
+ inputs,
953
+ clobbers,
954
+ volatile,
955
+ alignstack,
956
+ dialect,
957
+ ctxt -> _, // This is used for error reporting
958
+ } ) ;
1054
959
1055
960
impl_stable_hash_for ! ( enum hir:: def:: CtorKind {
1056
961
Fn ,
@@ -1113,8 +1018,7 @@ impl_stable_hash_for!(enum hir::Constness {
1113
1018
NotConst
1114
1019
} ) ;
1115
1020
1116
- impl < ' a > HashStable < StableHashingContext < ' a > >
1117
- for hir:: def_id:: DefIndex {
1021
+ impl < ' a > HashStable < StableHashingContext < ' a > > for hir:: def_id:: DefIndex {
1118
1022
1119
1023
fn hash_stable < W : StableHasherResult > ( & self ,
1120
1024
hcx : & mut StableHashingContext < ' a > ,
@@ -1140,8 +1044,7 @@ impl_stable_hash_for!(struct hir::def::Export {
1140
1044
span
1141
1045
} ) ;
1142
1046
1143
- impl < ' a > HashStable < StableHashingContext < ' a > >
1144
- for :: middle:: lang_items:: LangItem {
1047
+ impl < ' a > HashStable < StableHashingContext < ' a > > for :: middle:: lang_items:: LangItem {
1145
1048
fn hash_stable < W : StableHasherResult > ( & self ,
1146
1049
_: & mut StableHashingContext < ' a > ,
1147
1050
hasher : & mut StableHasher < W > ) {
@@ -1154,8 +1057,7 @@ impl_stable_hash_for!(struct ::middle::lang_items::LanguageItems {
1154
1057
missing
1155
1058
} ) ;
1156
1059
1157
- impl < ' a > HashStable < StableHashingContext < ' a > >
1158
- for hir:: TraitCandidate {
1060
+ impl < ' a > HashStable < StableHashingContext < ' a > > for hir:: TraitCandidate {
1159
1061
fn hash_stable < W : StableHasherResult > ( & self ,
1160
1062
hcx : & mut StableHashingContext < ' a > ,
1161
1063
hasher : & mut StableHasher < W > ) {
@@ -1189,26 +1091,13 @@ impl<'a> ToStableHashKey<StableHashingContext<'a>> for hir::TraitCandidate {
1189
1091
}
1190
1092
}
1191
1093
1192
- impl < ' hir > HashStable < StableHashingContext < ' hir > > for hir:: CodegenFnAttrs
1193
- {
1194
- fn hash_stable < W : StableHasherResult > ( & self ,
1195
- hcx : & mut StableHashingContext < ' hir > ,
1196
- hasher : & mut StableHasher < W > ) {
1197
- let hir:: CodegenFnAttrs {
1198
- flags,
1199
- inline,
1200
- export_name,
1201
- ref target_features,
1202
- linkage,
1203
- } = * self ;
1204
-
1205
- flags. hash_stable ( hcx, hasher) ;
1206
- inline. hash_stable ( hcx, hasher) ;
1207
- export_name. hash_stable ( hcx, hasher) ;
1208
- target_features. hash_stable ( hcx, hasher) ;
1209
- linkage. hash_stable ( hcx, hasher) ;
1210
- }
1211
- }
1094
+ impl_stable_hash_for ! ( struct hir:: CodegenFnAttrs {
1095
+ flags,
1096
+ inline,
1097
+ export_name,
1098
+ target_features,
1099
+ linkage,
1100
+ } ) ;
1212
1101
1213
1102
impl < ' hir > HashStable < StableHashingContext < ' hir > > for hir:: CodegenFnAttrFlags
1214
1103
{
0 commit comments