@@ -5,7 +5,7 @@ use crate::hir::{
5
5
TraitItem , TraitItemId , Ty , VisibilityKind ,
6
6
} ;
7
7
use crate :: hir_id:: { HirId , ItemLocalId } ;
8
- use rustc_span:: def_id:: { DefPathHash , LocalDefId } ;
8
+ use rustc_span:: def_id:: DefPathHash ;
9
9
10
10
/// Requirements for a `StableHashingContext` to be used in this crate.
11
11
/// This is a hack to allow using the `HashStable_Generic` derive macro
@@ -21,15 +21,14 @@ pub trait HashStableContext:
21
21
fn hash_hir_ty ( & mut self , _: & Ty < ' _ > , hasher : & mut StableHasher ) ;
22
22
fn hash_hir_visibility_kind ( & mut self , _: & VisibilityKind < ' _ > , hasher : & mut StableHasher ) ;
23
23
fn hash_hir_item_like < F : FnOnce ( & mut Self ) > ( & mut self , f : F ) ;
24
- fn local_def_path_hash ( & self , def_id : LocalDefId ) -> DefPathHash ;
25
24
}
26
25
27
26
impl < HirCtx : crate :: HashStableContext > ToStableHashKey < HirCtx > for HirId {
28
27
type KeyType = ( DefPathHash , ItemLocalId ) ;
29
28
30
29
#[ inline]
31
30
fn to_stable_hash_key ( & self , hcx : & HirCtx ) -> ( DefPathHash , ItemLocalId ) {
32
- let def_path_hash = hcx . local_def_path_hash ( self . owner ) ;
31
+ let def_path_hash = self . owner . to_stable_hash_key ( hcx ) ;
33
32
( def_path_hash, self . local_id )
34
33
}
35
34
}
@@ -39,7 +38,7 @@ impl<HirCtx: crate::HashStableContext> ToStableHashKey<HirCtx> for ItemId {
39
38
40
39
#[ inline]
41
40
fn to_stable_hash_key ( & self , hcx : & HirCtx ) -> DefPathHash {
42
- hcx . local_def_path_hash ( self . def_id )
41
+ self . def_id . to_stable_hash_key ( hcx )
43
42
}
44
43
}
45
44
@@ -48,7 +47,7 @@ impl<HirCtx: crate::HashStableContext> ToStableHashKey<HirCtx> for TraitItemId {
48
47
49
48
#[ inline]
50
49
fn to_stable_hash_key ( & self , hcx : & HirCtx ) -> DefPathHash {
51
- hcx . local_def_path_hash ( self . def_id )
50
+ self . def_id . to_stable_hash_key ( hcx )
52
51
}
53
52
}
54
53
@@ -57,7 +56,7 @@ impl<HirCtx: crate::HashStableContext> ToStableHashKey<HirCtx> for ImplItemId {
57
56
58
57
#[ inline]
59
58
fn to_stable_hash_key ( & self , hcx : & HirCtx ) -> DefPathHash {
60
- hcx . local_def_path_hash ( self . def_id )
59
+ self . def_id . to_stable_hash_key ( hcx )
61
60
}
62
61
}
63
62
@@ -66,7 +65,7 @@ impl<HirCtx: crate::HashStableContext> ToStableHashKey<HirCtx> for ForeignItemId
66
65
67
66
#[ inline]
68
67
fn to_stable_hash_key ( & self , hcx : & HirCtx ) -> DefPathHash {
69
- hcx . local_def_path_hash ( self . def_id )
68
+ self . def_id . to_stable_hash_key ( hcx )
70
69
}
71
70
}
72
71
0 commit comments