diff --git a/Cargo.lock b/Cargo.lock index f5ce875ccd428..8efbb50debbe2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -37,11 +37,12 @@ dependencies = [ [[package]] name = "ahash" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" dependencies = [ "cfg-if", + "getrandom", "once_cell", "version_check", "zerocopy", @@ -3663,6 +3664,7 @@ dependencies = [ name = "rustc_data_structures" version = "0.0.0" dependencies = [ + "ahash", "arrayvec", "bitflags 2.4.1", "elsa", @@ -6373,18 +6375,18 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.28" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d6f15f7ade05d2a4935e34a457b936c23dc70a05cc1d97133dc99e7a3fe0f0e" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.28" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbbad221e3f78500350ecbd7dfa4e63ef945c05f4c61cb7f4d3f84cd0bba649b" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", diff --git a/compiler/rustc_data_structures/Cargo.toml b/compiler/rustc_data_structures/Cargo.toml index 9d598c32e6fc4..a4557df35b821 100644 --- a/compiler/rustc_data_structures/Cargo.toml +++ b/compiler/rustc_data_structures/Cargo.toml @@ -4,6 +4,7 @@ version = "0.0.0" edition = "2021" [dependencies] +ahash = "0.8.7" # tidy-alphabetical-start arrayvec = { version = "0.7", default-features = false } bitflags = "2.4.1" diff --git a/compiler/rustc_data_structures/src/sharded.rs b/compiler/rustc_data_structures/src/sharded.rs index 162dbd234d676..036d297dc7914 100644 --- a/compiler/rustc_data_structures/src/sharded.rs +++ b/compiler/rustc_data_structures/src/sharded.rs @@ -1,4 +1,3 @@ -use crate::fx::{FxHashMap, FxHasher}; #[cfg(parallel_compiler)] use crate::sync::{is_dyn_thread_safe, CacheAligned}; use crate::sync::{Lock, LockGuard, Mode}; @@ -6,7 +5,7 @@ use crate::sync::{Lock, LockGuard, Mode}; use itertools::Either; use std::borrow::Borrow; use std::collections::hash_map::RawEntryMut; -use std::hash::{Hash, Hasher}; +use std::hash::{Hash, Hasher, BuildHasherDefault}; use std::iter; use std::mem; @@ -158,7 +157,7 @@ pub fn shards() -> usize { 1 } -pub type ShardedHashMap = Sharded>; +pub type ShardedHashMap = Sharded>>; impl ShardedHashMap { pub fn len(&self) -> usize { @@ -224,7 +223,7 @@ impl ShardedHashMap { #[inline] pub fn make_hash(val: &K) -> u64 { - let mut state = FxHasher::default(); + let mut state = ahash::AHasher::default(); val.hash(&mut state); state.finish() }