@@ -6,7 +6,7 @@ use crate::ich::{Fingerprint, NodeIdHashingMode, StableHashingContext};
6
6
use rustc_attr as attr;
7
7
use rustc_data_structures:: stable_hasher:: { HashStable , StableHasher , ToStableHashKey } ;
8
8
use rustc_hir as hir;
9
- use rustc_hir:: def_id:: { CrateNum , DefId , DefIndex , LocalDefId , CRATE_DEF_INDEX } ;
9
+ use rustc_hir:: def_id:: { CrateNum , DefId , LocalDefId , CRATE_DEF_INDEX } ;
10
10
use smallvec:: SmallVec ;
11
11
use std:: mem;
12
12
@@ -21,7 +21,7 @@ impl<'ctx> rustc_hir::HashStableContext for StableHashingContext<'ctx> {
21
21
NodeIdHashingMode :: HashDefPath => {
22
22
let hir:: HirId { owner, local_id } = hir_id;
23
23
24
- hcx. local_def_path_hash ( owner. local_def_index ) . hash_stable ( hcx, hasher) ;
24
+ hcx. local_def_path_hash ( owner) . hash_stable ( hcx, hasher) ;
25
25
local_id. hash_stable ( hcx, hasher) ;
26
26
}
27
27
}
@@ -116,8 +116,8 @@ impl<'ctx> rustc_hir::HashStableContext for StableHashingContext<'ctx> {
116
116
}
117
117
118
118
#[ inline]
119
- fn local_def_path_hash ( & self , def_index : DefIndex ) -> DefPathHash {
120
- self . local_def_path_hash ( def_index )
119
+ fn local_def_path_hash ( & self , def_id : LocalDefId ) -> DefPathHash {
120
+ self . local_def_path_hash ( def_id )
121
121
}
122
122
}
123
123
@@ -197,21 +197,6 @@ impl<'a> ToStableHashKey<StableHashingContext<'a>> for hir::BodyId {
197
197
}
198
198
}
199
199
200
- impl < ' a > HashStable < StableHashingContext < ' a > > for hir:: def_id:: DefIndex {
201
- fn hash_stable ( & self , hcx : & mut StableHashingContext < ' a > , hasher : & mut StableHasher ) {
202
- hcx. local_def_path_hash ( * self ) . hash_stable ( hcx, hasher) ;
203
- }
204
- }
205
-
206
- impl < ' a > ToStableHashKey < StableHashingContext < ' a > > for hir:: def_id:: DefIndex {
207
- type KeyType = DefPathHash ;
208
-
209
- #[ inline]
210
- fn to_stable_hash_key ( & self , hcx : & StableHashingContext < ' a > ) -> DefPathHash {
211
- hcx. local_def_path_hash ( * self )
212
- }
213
- }
214
-
215
200
impl < ' a > HashStable < StableHashingContext < ' a > > for hir:: TraitCandidate {
216
201
fn hash_stable ( & self , hcx : & mut StableHashingContext < ' a > , hasher : & mut StableHasher ) {
217
202
hcx. with_node_id_hashing_mode ( NodeIdHashingMode :: HashDefPath , |hcx| {
@@ -231,7 +216,7 @@ impl<'a> ToStableHashKey<StableHashingContext<'a>> for hir::TraitCandidate {
231
216
232
217
let import_keys = import_ids
233
218
. iter ( )
234
- . map ( |hir_id| ( hcx. local_def_path_hash ( hir_id. owner . local_def_index ) , hir_id. local_id ) )
219
+ . map ( |hir_id| ( hcx. local_def_path_hash ( hir_id. owner ) , hir_id. local_id ) )
235
220
. collect ( ) ;
236
221
( hcx. def_path_hash ( * def_id) , import_keys)
237
222
}
0 commit comments