about summary refs log tree commit diff
path: root/compiler/rustc_span/src
diff options
context:
space:
mode:
authorMark Rousskov <mark.simulacrum@gmail.com>2024-01-17 17:09:04 -0500
committerMark Rousskov <mark.simulacrum@gmail.com>2024-01-17 17:09:55 -0500
commit510fcd318b61d0e45165cdb0de880ee2f4f9cde2 (patch)
tree4da2d95424863ae37c416f9ceaf5001327211dc5 /compiler/rustc_span/src
parentc58a5da7d48ff3887afe4c618dc04defdee3dab5 (diff)
downloadrust-510fcd318b61d0e45165cdb0de880ee2f4f9cde2.tar.gz
rust-510fcd318b61d0e45165cdb0de880ee2f4f9cde2.zip
Use UnhashMap for a few more maps
This avoids hashing data that's already hashed.
Diffstat (limited to 'compiler/rustc_span/src')
-rw-r--r--compiler/rustc_span/src/hygiene.rs4
-rw-r--r--compiler/rustc_span/src/source_map.rs4
2 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_span/src/hygiene.rs b/compiler/rustc_span/src/hygiene.rs
index d03965b539c..5be794f3e17 100644
--- a/compiler/rustc_span/src/hygiene.rs
+++ b/compiler/rustc_span/src/hygiene.rs
@@ -330,7 +330,7 @@ pub(crate) struct HygieneData {
     /// would have collisions without a disambiguator.
     /// The keys of this map are always computed with `ExpnData.disambiguator`
     /// set to 0.
-    expn_data_disambiguators: FxHashMap<Hash64, u32>,
+    expn_data_disambiguators: UnhashMap<Hash64, u32>,
 }
 
 impl HygieneData {
@@ -359,7 +359,7 @@ impl HygieneData {
                 dollar_crate_name: kw::DollarCrate,
             }],
             syntax_context_map: FxHashMap::default(),
-            expn_data_disambiguators: FxHashMap::default(),
+            expn_data_disambiguators: UnhashMap::default(),
         }
     }
 
diff --git a/compiler/rustc_span/src/source_map.rs b/compiler/rustc_span/src/source_map.rs
index 72a8b23721d..df7635e447d 100644
--- a/compiler/rustc_span/src/source_map.rs
+++ b/compiler/rustc_span/src/source_map.rs
@@ -10,8 +10,8 @@
 //! information, source code snippets, etc.
 
 use crate::*;
-use rustc_data_structures::fx::FxHashMap;
 use rustc_data_structures::sync::{IntoDynSyncSend, MappedReadGuard, ReadGuard, RwLock};
+use rustc_data_structures::unhash::UnhashMap;
 use std::fs;
 use std::io::{self, BorrowedBuf, Read};
 use std::path::{self};
@@ -164,7 +164,7 @@ impl FileLoader for RealFileLoader {
 #[derive(Default)]
 struct SourceMapFiles {
     source_files: monotonic::MonotonicVec<Lrc<SourceFile>>,
-    stable_id_to_source_file: FxHashMap<StableSourceFileId, Lrc<SourceFile>>,
+    stable_id_to_source_file: UnhashMap<StableSourceFileId, Lrc<SourceFile>>,
 }
 
 pub struct SourceMap {