@@ -110,6 +110,7 @@ impl DefPathHash {
110110
111111 /// Builds a new [DefPathHash] with the given [StableCrateId] and
112112 /// `local_hash`, where `local_hash` must be unique within its crate.
113+ #[ inline]
113114 pub fn new ( stable_crate_id : StableCrateId , local_hash : Hash64 ) -> DefPathHash {
114115 DefPathHash ( Fingerprint :: new ( stable_crate_id. 0 , local_hash) )
115116 }
@@ -404,21 +405,21 @@ rustc_data_structures::define_id_collections!(
404405impl < CTX : HashStableContext > HashStable < CTX > for DefId {
405406 #[ inline]
406407 fn hash_stable ( & self , hcx : & mut CTX , hasher : & mut StableHasher ) {
407- self . to_stable_hash_key ( hcx ) . hash_stable ( hcx, hasher) ;
408+ hcx . def_path_hash ( * self ) . hash_stable ( hcx, hasher) ;
408409 }
409410}
410411
411412impl < CTX : HashStableContext > HashStable < CTX > for LocalDefId {
412413 #[ inline]
413414 fn hash_stable ( & self , hcx : & mut CTX , hasher : & mut StableHasher ) {
414- self . to_stable_hash_key ( hcx ) . hash_stable ( hcx, hasher) ;
415+ hcx . def_path_hash ( self . to_def_id ( ) ) . local_hash ( ) . hash_stable ( hcx, hasher) ;
415416 }
416417}
417418
418419impl < CTX : HashStableContext > HashStable < CTX > for CrateNum {
419420 #[ inline]
420421 fn hash_stable ( & self , hcx : & mut CTX , hasher : & mut StableHasher ) {
421- self . to_stable_hash_key ( hcx) . hash_stable ( hcx, hasher) ;
422+ self . as_def_id ( ) . to_stable_hash_key ( hcx) . stable_crate_id ( ) . hash_stable ( hcx, hasher) ;
422423 }
423424}
424425
0 commit comments