@@ -55,22 +55,19 @@ fn insert_vec_map<K: Idx, V: Clone>(map: &mut IndexVec<K, Option<V>>, k: K, v: V
55
55
map[ k] = Some ( v) ;
56
56
}
57
57
58
- fn hash (
59
- hcx : & mut StableHashingContext < ' _ > ,
60
- input : impl for < ' a > HashStable < StableHashingContext < ' a > > ,
61
- ) -> Fingerprint {
62
- let mut stable_hasher = StableHasher :: new ( ) ;
63
- input. hash_stable ( hcx, & mut stable_hasher) ;
64
- stable_hasher. finish ( )
65
- }
66
-
67
58
fn hash_body (
68
59
hcx : & mut StableHashingContext < ' _ > ,
69
60
def_path_hash : DefPathHash ,
70
61
item_like : impl for < ' a > HashStable < StableHashingContext < ' a > > ,
71
62
hir_body_nodes : & mut Vec < ( DefPathHash , Fingerprint ) > ,
72
63
) -> Fingerprint {
73
- let hash = hash ( hcx, HirItemLike { item_like : & item_like } ) ;
64
+ let hash = {
65
+ let mut stable_hasher = StableHasher :: new ( ) ;
66
+ hcx. while_hashing_hir_bodies ( true , |hcx| {
67
+ item_like. hash_stable ( hcx, & mut stable_hasher) ;
68
+ } ) ;
69
+ stable_hasher. finish ( )
70
+ } ;
74
71
hir_body_nodes. push ( ( def_path_hash, hash) ) ;
75
72
hash
76
73
}
@@ -575,18 +572,3 @@ impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> {
575
572
self . visit_nested_foreign_item ( id) ;
576
573
}
577
574
}
578
-
579
- struct HirItemLike < T > {
580
- item_like : T ,
581
- }
582
-
583
- impl < ' hir , T > HashStable < StableHashingContext < ' hir > > for HirItemLike < T >
584
- where
585
- T : HashStable < StableHashingContext < ' hir > > ,
586
- {
587
- fn hash_stable ( & self , hcx : & mut StableHashingContext < ' hir > , hasher : & mut StableHasher ) {
588
- hcx. while_hashing_hir_bodies ( true , |hcx| {
589
- self . item_like . hash_stable ( hcx, hasher) ;
590
- } ) ;
591
- }
592
- }
0 commit comments