@@ -88,8 +88,6 @@ pub(crate) struct CrateMetadata {
8888 alloc_decoding_state : AllocDecodingState ,
8989 /// Caches decoded `DefKey`s.
9090 def_key_cache : Lock < FxHashMap < DefIndex , DefKey > > ,
91- /// Caches decoded `DefPathHash`es.
92- def_path_hash_cache : Lock < FxHashMap < DefIndex , DefPathHash > > ,
9391
9492 // --- Other significant crate properties ---
9593 /// ID of this crate, from the current compilation session's point of view.
@@ -1485,27 +1483,16 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
14851483 DefPath :: make ( self . cnum , id, |parent| self . def_key ( parent) )
14861484 }
14871485
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-
15051486 #[ inline]
15061487 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 )
15091496 }
15101497
15111498 #[ inline]
@@ -1832,7 +1819,6 @@ impl CrateMetadata {
18321819 extern_crate : Lock :: new ( None ) ,
18331820 hygiene_context : Default :: default ( ) ,
18341821 def_key_cache : Default :: default ( ) ,
1835- def_path_hash_cache : Default :: default ( ) ,
18361822 } ;
18371823
18381824 // Need `CrateMetadataRef` to decode `DefId`s in simplified types.
0 commit comments