about summary refs log tree commit diff
path: root/compiler/rustc_data_structures
diff options
context:
space:
mode:
authorJohn Kåre Alsaker <john.kare.alsaker@gmail.com>2023-08-16 17:50:40 +0200
committerJohn Kåre Alsaker <john.kare.alsaker@gmail.com>2025-03-21 07:51:20 +0100
commitfcd3349d14af8b217b849f030e5d8ffd5e99f0d7 (patch)
tree97804fca658a76a4256549ff65dbc5fbf00347b7 /compiler/rustc_data_structures
parent01dc45c10e814c25207995a577359e3f137e78ae (diff)
downloadrust-fcd3349d14af8b217b849f030e5d8ffd5e99f0d7.tar.gz
rust-fcd3349d14af8b217b849f030e5d8ffd5e99f0d7.zip
Optimize hash map operations in the query system
Diffstat (limited to 'compiler/rustc_data_structures')
-rw-r--r--compiler/rustc_data_structures/Cargo.toml5
-rw-r--r--compiler/rustc_data_structures/src/lib.rs2
-rw-r--r--compiler/rustc_data_structures/src/sharded.rs2
3 files changed, 3 insertions, 6 deletions
diff --git a/compiler/rustc_data_structures/Cargo.toml b/compiler/rustc_data_structures/Cargo.toml
index fcaf2750507..df3bee6ee9c 100644
--- a/compiler/rustc_data_structures/Cargo.toml
+++ b/compiler/rustc_data_structures/Cargo.toml
@@ -29,11 +29,6 @@ thin-vec = "0.2.12"
 tracing = "0.1"
 # tidy-alphabetical-end
 
-[dependencies.hashbrown]
-version = "0.15.2"
-default-features = false
-features = ["nightly"] # for may_dangle
-
 [dependencies.parking_lot]
 version = "0.12"
 
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<K: Eq + Hash + Copy + IntoPointer> ShardedHashMap<K, ()> {
 }
 
 #[inline]
-fn make_hash<K: Hash + ?Sized>(val: &K) -> u64 {
+pub fn make_hash<K: Hash + ?Sized>(val: &K) -> u64 {
     let mut state = FxHasher::default();
     val.hash(&mut state);
     state.finish()