@@ -88,8 +88,6 @@ pub(crate) struct CrateMetadata {
88
88
alloc_decoding_state : AllocDecodingState ,
89
89
/// Caches decoded `DefKey`s.
90
90
def_key_cache : Lock < FxHashMap < DefIndex , DefKey > > ,
91
- /// Caches decoded `DefPathHash`es.
92
- def_path_hash_cache : Lock < FxHashMap < DefIndex , DefPathHash > > ,
93
91
94
92
// --- Other significant crate properties ---
95
93
/// ID of this crate, from the current compilation session's point of view.
@@ -1485,27 +1483,16 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
1485
1483
DefPath :: make ( self . cnum , id, |parent| self . def_key ( parent) )
1486
1484
}
1487
1485
1488
- fn def_path_hash_unlocked (
1489
- self ,
1490
- index : DefIndex ,
1491
- def_path_hashes : & mut FxHashMap < DefIndex , DefPathHash > ,
1492
- ) -> DefPathHash {
1493
- * def_path_hashes. entry ( index) . or_insert_with ( || {
1494
- // This is a hack to workaround the fact that we can't easily encode/decode a Hash64
1495
- // into the FixedSizeEncoding, as Hash64 lacks a Default impl. A future refactor to
1496
- // relax the Default restriction will likely fix this.
1497
- let fingerprint = Fingerprint :: new (
1498
- self . root . stable_crate_id . as_u64 ( ) ,
1499
- self . root . tables . def_path_hashes . get ( self , index) ,
1500
- ) ;
1501
- DefPathHash :: new ( self . root . stable_crate_id , fingerprint. split ( ) . 1 )
1502
- } )
1503
- }
1504
-
1505
1486
#[ inline]
1506
1487
fn def_path_hash ( self , index : DefIndex ) -> DefPathHash {
1507
- let mut def_path_hashes = self . def_path_hash_cache . lock ( ) ;
1508
- self . def_path_hash_unlocked ( index, & mut def_path_hashes)
1488
+ // This is a hack to workaround the fact that we can't easily encode/decode a Hash64
1489
+ // into the FixedSizeEncoding, as Hash64 lacks a Default impl. A future refactor to
1490
+ // relax the Default restriction will likely fix this.
1491
+ let fingerprint = Fingerprint :: new (
1492
+ self . root . stable_crate_id . as_u64 ( ) ,
1493
+ self . root . tables . def_path_hashes . get ( self , index) ,
1494
+ ) ;
1495
+ DefPathHash :: new ( self . root . stable_crate_id , fingerprint. split ( ) . 1 )
1509
1496
}
1510
1497
1511
1498
#[ inline]
@@ -1832,7 +1819,6 @@ impl CrateMetadata {
1832
1819
extern_crate : Lock :: new ( None ) ,
1833
1820
hygiene_context : Default :: default ( ) ,
1834
1821
def_key_cache : Default :: default ( ) ,
1835
- def_path_hash_cache : Default :: default ( ) ,
1836
1822
} ;
1837
1823
1838
1824
// Need `CrateMetadataRef` to decode `DefId`s in simplified types.
0 commit comments