@@ -8,6 +8,7 @@ use rustc_data_structures::fingerprint::{Fingerprint, FingerprintDecoder, Finger
88use rustc_data_structures:: fx:: { FxHashMap , FxHashSet , FxIndexSet } ;
99use rustc_data_structures:: sync:: { HashMapExt , Lock , Lrc , OnceCell } ;
1010use rustc_data_structures:: thin_vec:: ThinVec ;
11+ use rustc_data_structures:: unhash:: UnhashMap ;
1112use rustc_errors:: Diagnostic ;
1213use rustc_hir:: def_id:: { CrateNum , DefId , DefIndex , LocalDefId , LOCAL_CRATE } ;
1314use rustc_hir:: definitions:: DefPathHash ;
@@ -87,27 +88,27 @@ pub struct OnDiskCache<'sess> {
8788 // compilation session. This is used as an initial 'guess' when
8889 // we try to map a `DefPathHash` to its `DefId` in the current compilation
8990 // session.
90- foreign_def_path_hashes : FxHashMap < DefPathHash , RawDefId > ,
91+ foreign_def_path_hashes : UnhashMap < DefPathHash , RawDefId > ,
9192
9293 // The *next* compilation sessison's `foreign_def_path_hashes` - at
9394 // the end of our current compilation session, this will get written
9495 // out to the `foreign_def_path_hashes` field of the `Footer`, which
9596 // will become `foreign_def_path_hashes` of the next compilation session.
9697 // This stores any `DefPathHash` that we may need to map to a `DefId`
9798 // during the next compilation session.
98- latest_foreign_def_path_hashes : Lock < FxHashMap < DefPathHash , RawDefId > > ,
99+ latest_foreign_def_path_hashes : Lock < UnhashMap < DefPathHash , RawDefId > > ,
99100
100101 // Maps `DefPathHashes` to their corresponding `LocalDefId`s for all
101102 // local items in the current compilation session. This is only populated
102103 // when we are in incremental mode and have loaded a pre-existing cache
103104 // from disk, since this map is only used when deserializing a `DefPathHash`
104105 // from the incremental cache.
105- local_def_path_hash_to_def_id : FxHashMap < DefPathHash , LocalDefId > ,
106+ local_def_path_hash_to_def_id : UnhashMap < DefPathHash , LocalDefId > ,
106107 // Caches all lookups of `DefPathHashes`, both for local and foreign
107108 // definitions. A definition from the previous compilation session
108109 // may no longer exist in the current compilation session, so
109110 // we use `Option<DefId>` so that we can cache a lookup failure.
110- def_path_hash_to_def_id_cache : Lock < FxHashMap < DefPathHash , Option < DefId > > > ,
111+ def_path_hash_to_def_id_cache : Lock < UnhashMap < DefPathHash , Option < DefId > > > ,
111112}
112113
113114// This type is used only for serialization and deserialization.
@@ -123,7 +124,7 @@ struct Footer {
123124 syntax_contexts : FxHashMap < u32 , AbsoluteBytePos > ,
124125 // See `OnDiskCache.expn_data`
125126 expn_data : FxHashMap < u32 , AbsoluteBytePos > ,
126- foreign_def_path_hashes : FxHashMap < DefPathHash , RawDefId > ,
127+ foreign_def_path_hashes : UnhashMap < DefPathHash , RawDefId > ,
127128}
128129
129130type EncodedQueryResultIndex = Vec < ( SerializedDepNodeIndex , AbsoluteBytePos ) > ;
@@ -160,8 +161,8 @@ crate struct RawDefId {
160161 pub index : u32 ,
161162}
162163
163- fn make_local_def_path_hash_map ( definitions : & Definitions ) -> FxHashMap < DefPathHash , LocalDefId > {
164- FxHashMap :: from_iter (
164+ fn make_local_def_path_hash_map ( definitions : & Definitions ) -> UnhashMap < DefPathHash , LocalDefId > {
165+ UnhashMap :: from_iter (
165166 definitions
166167 . def_path_table ( )
167168 . all_def_path_hashes_and_def_ids ( LOCAL_CRATE )
@@ -973,7 +974,7 @@ struct CacheEncoder<'a, 'tcx, E: OpaqueEncoder> {
973974 source_map : CachingSourceMapView < ' tcx > ,
974975 file_to_file_index : FxHashMap < * const SourceFile , SourceFileIndex > ,
975976 hygiene_context : & ' a HygieneEncodeContext ,
976- latest_foreign_def_path_hashes : FxHashMap < DefPathHash , RawDefId > ,
977+ latest_foreign_def_path_hashes : UnhashMap < DefPathHash , RawDefId > ,
977978}
978979
979980impl < ' a , ' tcx , E > CacheEncoder < ' a , ' tcx , E >
0 commit comments