Skip to content

Commit 1c58522

Browse files
Use FxHasher on new solver unconditionally
1 parent f167efa commit 1c58522

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

Cargo.lock

+1
Original file line numberDiff line numberDiff line change
@@ -4543,6 +4543,7 @@ dependencies = [
45434543
"bitflags 2.6.0",
45444544
"derive-where",
45454545
"indexmap",
4546+
"rustc-hash",
45464547
"rustc_ast_ir",
45474548
"rustc_data_structures",
45484549
"rustc_index",

compiler/rustc_type_ir/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ edition = "2021"
88
bitflags = "2.4.1"
99
derive-where = "1.2.7"
1010
indexmap = "2.0.0"
11+
rustc-hash = "1.1.0"
1112
rustc_ast_ir = { path = "../rustc_ast_ir", default-features = false }
1213
rustc_data_structures = { path = "../rustc_data_structures", optional = true }
1314
rustc_index = { path = "../rustc_index", default-features = false }

compiler/rustc_type_ir/src/data_structures.rs

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
1+
use std::hash::BuildHasherDefault;
2+
3+
use rustc_hash::FxHasher;
4+
pub use rustc_hash::{FxHashMap as HashMap, FxHashSet as HashSet};
5+
6+
pub type IndexMap<K, V> = indexmap::IndexMap<K, V, BuildHasherDefault<FxHasher>>;
7+
pub type IndexSet<V> = indexmap::IndexSet<V, BuildHasherDefault<FxHasher>>;
8+
19
#[cfg(feature = "nightly")]
210
mod impl_ {
3-
pub use rustc_data_structures::fx::{
4-
FxHashMap as HashMap, FxHashSet as HashSet, FxIndexMap as IndexMap, FxIndexSet as IndexSet,
5-
};
611
pub use rustc_data_structures::sso::{SsoHashMap, SsoHashSet};
712
pub use rustc_data_structures::stack::ensure_sufficient_stack;
813
pub use rustc_data_structures::sync::Lrc;
914
}
1015

1116
#[cfg(not(feature = "nightly"))]
1217
mod impl_ {
13-
pub use std::collections::{HashMap, HashMap as SsoHashMap, HashSet, HashSet as SsoHashSet};
18+
pub use std::collections::{HashMap as SsoHashMap, HashSet as SsoHashSet};
1419
pub use std::sync::Arc as Lrc;
1520

16-
pub use indexmap::{IndexMap, IndexSet};
17-
1821
#[inline]
1922
pub fn ensure_sufficient_stack<R>(f: impl FnOnce() -> R) -> R {
2023
f()

0 commit comments

Comments
 (0)