Skip to content

Commit f8a9bd5

Browse files
authored
Unrolled build for rust-lang#129526
Rollup merge of rust-lang#129526 - compiler-errors:fx, r=lqd Use `FxHasher` on new solver unconditionally r? lqd This should actually fix the inference problem in ad855fe, since `HashSet::default` was not inferring the hasher when `HashSet` was coming from the stdlib due to the way that defaulted types/inference vars work. You could cherry-pick this on top of your PR alternatively.
2 parents 3f121b9 + 1c58522 commit f8a9bd5

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
@@ -4536,6 +4536,7 @@ dependencies = [
45364536
"bitflags 2.6.0",
45374537
"derive-where",
45384538
"indexmap",
4539+
"rustc-hash",
45394540
"rustc_ast_ir",
45404541
"rustc_data_structures",
45414542
"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)