@@ -110,6 +110,7 @@ impl DefPathHash {
110
110
111
111
/// Builds a new [DefPathHash] with the given [StableCrateId] and
112
112
/// `local_hash`, where `local_hash` must be unique within its crate.
113
+ #[ inline]
113
114
pub fn new ( stable_crate_id : StableCrateId , local_hash : Hash64 ) -> DefPathHash {
114
115
DefPathHash ( Fingerprint :: new ( stable_crate_id. 0 , local_hash) )
115
116
}
@@ -404,21 +405,21 @@ rustc_data_structures::define_id_collections!(
404
405
impl < CTX : HashStableContext > HashStable < CTX > for DefId {
405
406
#[ inline]
406
407
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) ;
408
409
}
409
410
}
410
411
411
412
impl < CTX : HashStableContext > HashStable < CTX > for LocalDefId {
412
413
#[ inline]
413
414
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) ;
415
416
}
416
417
}
417
418
418
419
impl < CTX : HashStableContext > HashStable < CTX > for CrateNum {
419
420
#[ inline]
420
421
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) ;
422
423
}
423
424
}
424
425
0 commit comments