Skip to content

Commit f8ad88b

Browse files
committed
Use UnhashMap for the index
1 parent 734e5a1 commit f8ad88b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

compiler/rustc_query_system/src/dep_graph/serialized.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ use rustc_data_structures::fingerprint::PackedFingerprint;
4343
use rustc_data_structures::fx::FxHashMap;
4444
use rustc_data_structures::profiling::SelfProfilerRef;
4545
use rustc_data_structures::sync::Lock;
46+
use rustc_data_structures::unhash::UnhashMap;
4647
use rustc_index::{Idx, IndexVec};
4748
use rustc_serialize::opaque::{FileEncodeResult, FileEncoder, IntEncodedWithFixedSize, MemDecoder};
4849
use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
@@ -84,7 +85,7 @@ pub struct SerializedDepGraph<K: DepKind> {
8485
edge_list_data: Vec<u8>,
8586
/// Stores a map from fingerprints to nodes per dep node kind.
8687
/// This is the reciprocal of `nodes`.
87-
index: Vec<FxHashMap<PackedFingerprint, SerializedDepNodeIndex>>,
88+
index: Vec<UnhashMap<PackedFingerprint, SerializedDepNodeIndex>>,
8889
}
8990

9091
impl<K: DepKind> Default for SerializedDepGraph<K> {
@@ -256,7 +257,7 @@ impl<'a, K: DepKind + Decodable<MemDecoder<'a>>> Decodable<MemDecoder<'a>>
256257

257258
// Read the number of each dep kind and use it to create an hash map with a suitable size.
258259
let mut index: Vec<_> = (0..(K::MAX as usize + 1))
259-
.map(|_| FxHashMap::with_capacity_and_hasher(d.read_u32() as usize, Default::default()))
260+
.map(|_| UnhashMap::with_capacity_and_hasher(d.read_u32() as usize, Default::default()))
260261
.collect();
261262

262263
for (idx, node) in nodes.iter_enumerated() {

0 commit comments

Comments
 (0)