@@ -308,21 +308,23 @@ impl<D: Decoder> Decodable<D> for LocalDefId {
308308rustc_data_structures:: define_id_collections!( LocalDefIdMap , LocalDefIdSet , LocalDefId ) ;
309309
310310impl < CTX : HashStableContext > HashStable < CTX > for DefId {
311+ #[ inline]
311312 fn hash_stable ( & self , hcx : & mut CTX , hasher : & mut StableHasher ) {
312- hcx . def_path_hash ( * self ) . hash_stable ( hcx, hasher) ;
313+ self . to_stable_hash_key ( hcx ) . hash_stable ( hcx, hasher) ;
313314 }
314315}
315316
316317impl < CTX : HashStableContext > HashStable < CTX > for LocalDefId {
317318 #[ inline]
318319 fn hash_stable ( & self , hcx : & mut CTX , hasher : & mut StableHasher ) {
319- hcx . def_path_hash ( self . to_def_id ( ) ) . hash_stable ( hcx, hasher) ;
320+ self . to_stable_hash_key ( hcx ) . hash_stable ( hcx, hasher) ;
320321 }
321322}
322323
323324impl < CTX : HashStableContext > HashStable < CTX > for CrateNum {
325+ #[ inline]
324326 fn hash_stable ( & self , hcx : & mut CTX , hasher : & mut StableHasher ) {
325- hcx . def_path_hash ( DefId { krate : * self , index : CRATE_DEF_INDEX } ) . hash_stable ( hcx, hasher) ;
327+ self . to_stable_hash_key ( hcx ) . hash_stable ( hcx, hasher) ;
326328 }
327329}
328330
@@ -349,7 +351,6 @@ impl<CTX: HashStableContext> ToStableHashKey<CTX> for CrateNum {
349351
350352 #[ inline]
351353 fn to_stable_hash_key ( & self , hcx : & CTX ) -> DefPathHash {
352- let def_id = DefId { krate : * self , index : CRATE_DEF_INDEX } ;
353- def_id. to_stable_hash_key ( hcx)
354+ self . as_def_id ( ) . to_stable_hash_key ( hcx)
354355 }
355356}
0 commit comments