@@ -8,6 +8,7 @@ use rustc_data_structures::fingerprint::{Fingerprint, FingerprintDecoder, Finger
8
8
use rustc_data_structures:: fx:: { FxHashMap , FxHashSet , FxIndexSet } ;
9
9
use rustc_data_structures:: sync:: { HashMapExt , Lock , Lrc , OnceCell } ;
10
10
use rustc_data_structures:: thin_vec:: ThinVec ;
11
+ use rustc_data_structures:: unhash:: UnhashMap ;
11
12
use rustc_errors:: Diagnostic ;
12
13
use rustc_hir:: def_id:: { CrateNum , DefId , DefIndex , LocalDefId , LOCAL_CRATE } ;
13
14
use rustc_hir:: definitions:: DefPathHash ;
@@ -87,27 +88,27 @@ pub struct OnDiskCache<'sess> {
87
88
// compilation session. This is used as an initial 'guess' when
88
89
// we try to map a `DefPathHash` to its `DefId` in the current compilation
89
90
// session.
90
- foreign_def_path_hashes : FxHashMap < DefPathHash , RawDefId > ,
91
+ foreign_def_path_hashes : UnhashMap < DefPathHash , RawDefId > ,
91
92
92
93
// The *next* compilation sessison's `foreign_def_path_hashes` - at
93
94
// the end of our current compilation session, this will get written
94
95
// out to the `foreign_def_path_hashes` field of the `Footer`, which
95
96
// will become `foreign_def_path_hashes` of the next compilation session.
96
97
// This stores any `DefPathHash` that we may need to map to a `DefId`
97
98
// 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 > > ,
99
100
100
101
// Maps `DefPathHashes` to their corresponding `LocalDefId`s for all
101
102
// local items in the current compilation session. This is only populated
102
103
// when we are in incremental mode and have loaded a pre-existing cache
103
104
// from disk, since this map is only used when deserializing a `DefPathHash`
104
105
// 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 > ,
106
107
// Caches all lookups of `DefPathHashes`, both for local and foreign
107
108
// definitions. A definition from the previous compilation session
108
109
// may no longer exist in the current compilation session, so
109
110
// 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 > > > ,
111
112
}
112
113
113
114
// This type is used only for serialization and deserialization.
@@ -123,7 +124,7 @@ struct Footer {
123
124
syntax_contexts : FxHashMap < u32 , AbsoluteBytePos > ,
124
125
// See `OnDiskCache.expn_data`
125
126
expn_data : FxHashMap < u32 , AbsoluteBytePos > ,
126
- foreign_def_path_hashes : FxHashMap < DefPathHash , RawDefId > ,
127
+ foreign_def_path_hashes : UnhashMap < DefPathHash , RawDefId > ,
127
128
}
128
129
129
130
type EncodedQueryResultIndex = Vec < ( SerializedDepNodeIndex , AbsoluteBytePos ) > ;
@@ -160,8 +161,8 @@ crate struct RawDefId {
160
161
pub index : u32 ,
161
162
}
162
163
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 (
165
166
definitions
166
167
. def_path_table ( )
167
168
. all_def_path_hashes_and_def_ids ( LOCAL_CRATE )
@@ -973,7 +974,7 @@ struct CacheEncoder<'a, 'tcx, E: OpaqueEncoder> {
973
974
source_map : CachingSourceMapView < ' tcx > ,
974
975
file_to_file_index : FxHashMap < * const SourceFile , SourceFileIndex > ,
975
976
hygiene_context : & ' a HygieneEncodeContext ,
976
- latest_foreign_def_path_hashes : FxHashMap < DefPathHash , RawDefId > ,
977
+ latest_foreign_def_path_hashes : UnhashMap < DefPathHash , RawDefId > ,
977
978
}
978
979
979
980
impl < ' a , ' tcx , E > CacheEncoder < ' a , ' tcx , E >
0 commit comments