From fcd3349d14af8b217b849f030e5d8ffd5e99f0d7 Mon Sep 17 00:00:00 2001 From: John Kåre Alsaker Date: Wed, 16 Aug 2023 17:50:40 +0200 Subject: Optimize hash map operations in the query system --- compiler/rustc_data_structures/src/lib.rs | 2 ++ compiler/rustc_data_structures/src/sharded.rs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'compiler/rustc_data_structures/src') diff --git a/compiler/rustc_data_structures/src/lib.rs b/compiler/rustc_data_structures/src/lib.rs index 865424fd6bb..244997f5611 100644 --- a/compiler/rustc_data_structures/src/lib.rs +++ b/compiler/rustc_data_structures/src/lib.rs @@ -38,6 +38,8 @@ #![feature(unwrap_infallible)] // tidy-alphabetical-end +extern crate hashbrown; + use std::fmt; pub use atomic_ref::AtomicRef; diff --git a/compiler/rustc_data_structures/src/sharded.rs b/compiler/rustc_data_structures/src/sharded.rs index 49cafcb17a0..5de9413cf15 100644 --- a/compiler/rustc_data_structures/src/sharded.rs +++ b/compiler/rustc_data_structures/src/sharded.rs @@ -256,7 +256,7 @@ impl ShardedHashMap { } #[inline] -fn make_hash(val: &K) -> u64 { +pub fn make_hash(val: &K) -> u64 { let mut state = FxHasher::default(); val.hash(&mut state); state.finish() -- cgit 1.4.1-3-g733a5