@@ -6,7 +6,7 @@ use crate::ich::{Fingerprint, NodeIdHashingMode, StableHashingContext};
66use rustc_attr as attr;
77use rustc_data_structures:: stable_hasher:: { HashStable , StableHasher , ToStableHashKey } ;
88use 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 } ;
1010use smallvec:: SmallVec ;
1111use std:: mem;
1212
@@ -21,7 +21,7 @@ impl<'ctx> rustc_hir::HashStableContext for StableHashingContext<'ctx> {
2121 NodeIdHashingMode :: HashDefPath => {
2222 let hir:: HirId { owner, local_id } = hir_id;
2323
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) ;
2525 local_id. hash_stable ( hcx, hasher) ;
2626 }
2727 }
@@ -116,8 +116,8 @@ impl<'ctx> rustc_hir::HashStableContext for StableHashingContext<'ctx> {
116116 }
117117
118118 #[ 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 )
121121 }
122122}
123123
@@ -197,21 +197,6 @@ impl<'a> ToStableHashKey<StableHashingContext<'a>> for hir::BodyId {
197197 }
198198}
199199
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-
215200impl < ' a > HashStable < StableHashingContext < ' a > > for hir:: TraitCandidate {
216201 fn hash_stable ( & self , hcx : & mut StableHashingContext < ' a > , hasher : & mut StableHasher ) {
217202 hcx. with_node_id_hashing_mode ( NodeIdHashingMode :: HashDefPath , |hcx| {
@@ -231,7 +216,7 @@ impl<'a> ToStableHashKey<StableHashingContext<'a>> for hir::TraitCandidate {
231216
232217 let import_keys = import_ids
233218 . 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 ) )
235220 . collect ( ) ;
236221 ( hcx. def_path_hash ( * def_id) , import_keys)
237222 }
0 commit comments