@@ -529,63 +529,9 @@ impl<'gcx> HashStable<StableHashingContext<'gcx>> for hir::Expr {
529
529
ref attrs
530
530
} = * self ;
531
531
532
- let spans_always_on = match * node {
533
- hir:: ExprBox ( ..) |
534
- hir:: ExprArray ( ..) |
535
- hir:: ExprCall ( ..) |
536
- hir:: ExprLit ( ..) |
537
- hir:: ExprCast ( ..) |
538
- hir:: ExprType ( ..) |
539
- hir:: ExprIf ( ..) |
540
- hir:: ExprWhile ( ..) |
541
- hir:: ExprLoop ( ..) |
542
- hir:: ExprMatch ( ..) |
543
- hir:: ExprClosure ( ..) |
544
- hir:: ExprBlock ( ..) |
545
- hir:: ExprAssign ( ..) |
546
- hir:: ExprTupField ( ..) |
547
- hir:: ExprAddrOf ( ..) |
548
- hir:: ExprBreak ( ..) |
549
- hir:: ExprAgain ( ..) |
550
- hir:: ExprRet ( ..) |
551
- hir:: ExprYield ( ..) |
552
- hir:: ExprInlineAsm ( ..) |
553
- hir:: ExprRepeat ( ..) |
554
- hir:: ExprTup ( ..) |
555
- hir:: ExprMethodCall ( ..) |
556
- hir:: ExprPath ( ..) |
557
- hir:: ExprStruct ( ..) |
558
- hir:: ExprField ( ..) => {
559
- // For these we only hash the span when debuginfo is on.
560
- false
561
- }
562
- // For the following, spans might be significant because of
563
- // panic messages indicating the source location.
564
- hir:: ExprBinary ( op, ..) => {
565
- hcx. binop_can_panic_at_runtime ( op. node )
566
- }
567
- hir:: ExprUnary ( op, _) => {
568
- hcx. unop_can_panic_at_runtime ( op)
569
- }
570
- hir:: ExprAssignOp ( op, ..) => {
571
- hcx. binop_can_panic_at_runtime ( op. node )
572
- }
573
- hir:: ExprIndex ( ..) => {
574
- true
575
- }
576
- } ;
577
-
578
- if spans_always_on {
579
- hcx. while_hashing_spans ( true , |hcx| {
580
- span. hash_stable ( hcx, hasher) ;
581
- node. hash_stable ( hcx, hasher) ;
582
- attrs. hash_stable ( hcx, hasher) ;
583
- } ) ;
584
- } else {
585
- span. hash_stable ( hcx, hasher) ;
586
- node. hash_stable ( hcx, hasher) ;
587
- attrs. hash_stable ( hcx, hasher) ;
588
- }
532
+ span. hash_stable ( hcx, hasher) ;
533
+ node. hash_stable ( hcx, hasher) ;
534
+ attrs. hash_stable ( hcx, hasher) ;
589
535
} )
590
536
}
591
537
}
@@ -712,15 +658,7 @@ impl<'gcx> HashStable<StableHashingContext<'gcx>> for hir::TraitItem {
712
658
span
713
659
} = * self ;
714
660
715
- let is_const = match * node {
716
- hir:: TraitItemKind :: Const ( ..) |
717
- hir:: TraitItemKind :: Type ( ..) => true ,
718
- hir:: TraitItemKind :: Method ( hir:: MethodSig { constness, .. } , _) => {
719
- constness == hir:: Constness :: Const
720
- }
721
- } ;
722
-
723
- hcx. hash_hir_item_like ( attrs, is_const, |hcx| {
661
+ hcx. hash_hir_item_like ( |hcx| {
724
662
name. hash_stable ( hcx, hasher) ;
725
663
attrs. hash_stable ( hcx, hasher) ;
726
664
generics. hash_stable ( hcx, hasher) ;
@@ -757,15 +695,7 @@ impl<'gcx> HashStable<StableHashingContext<'gcx>> for hir::ImplItem {
757
695
span
758
696
} = * self ;
759
697
760
- let is_const = match * node {
761
- hir:: ImplItemKind :: Const ( ..) |
762
- hir:: ImplItemKind :: Type ( ..) => true ,
763
- hir:: ImplItemKind :: Method ( hir:: MethodSig { constness, .. } , _) => {
764
- constness == hir:: Constness :: Const
765
- }
766
- } ;
767
-
768
- hcx. hash_hir_item_like ( attrs, is_const, |hcx| {
698
+ hcx. hash_hir_item_like ( |hcx| {
769
699
name. hash_stable ( hcx, hasher) ;
770
700
vis. hash_stable ( hcx, hasher) ;
771
701
defaultness. hash_stable ( hcx, hasher) ;
@@ -884,30 +814,6 @@ impl<'gcx> HashStable<StableHashingContext<'gcx>> for hir::Item {
884
814
fn hash_stable < W : StableHasherResult > ( & self ,
885
815
hcx : & mut StableHashingContext < ' gcx > ,
886
816
hasher : & mut StableHasher < W > ) {
887
- let is_const = match self . node {
888
- hir:: ItemStatic ( ..) |
889
- hir:: ItemConst ( ..) => {
890
- true
891
- }
892
- hir:: ItemFn ( _, _, constness, ..) => {
893
- constness == hir:: Constness :: Const
894
- }
895
- hir:: ItemUse ( ..) |
896
- hir:: ItemExternCrate ( ..) |
897
- hir:: ItemForeignMod ( ..) |
898
- hir:: ItemGlobalAsm ( ..) |
899
- hir:: ItemMod ( ..) |
900
- hir:: ItemAutoImpl ( ..) |
901
- hir:: ItemTrait ( ..) |
902
- hir:: ItemImpl ( ..) |
903
- hir:: ItemTy ( ..) |
904
- hir:: ItemEnum ( ..) |
905
- hir:: ItemStruct ( ..) |
906
- hir:: ItemUnion ( ..) => {
907
- false
908
- }
909
- } ;
910
-
911
817
let hir:: Item {
912
818
name,
913
819
ref attrs,
@@ -918,7 +824,7 @@ impl<'gcx> HashStable<StableHashingContext<'gcx>> for hir::Item {
918
824
span
919
825
} = * self ;
920
826
921
- hcx. hash_hir_item_like ( attrs , is_const , |hcx| {
827
+ hcx. hash_hir_item_like ( |hcx| {
922
828
name. hash_stable ( hcx, hasher) ;
923
829
attrs. hash_stable ( hcx, hasher) ;
924
830
node. hash_stable ( hcx, hasher) ;
0 commit comments