From f3c36ce6924f873c4d4bf02e4425b562091d3ac8 Mon Sep 17 00:00:00 2001 From: Amanieu d'Antras Date: Mon, 22 Sep 2025 21:15:46 +0100 Subject: [PATCH] [EXPERIMENT] Test 8-bit tags for hashbrown See rust-lang/hashbrown#653 --- library/Cargo.lock | 12 +++++++++--- library/std/Cargo.toml | 2 +- library/std/src/collections/hash/map.rs | 4 ++-- src/tools/tidy/src/deps.rs | 2 ++ src/tools/tidy/src/extdeps.rs | 1 + 5 files changed, 15 insertions(+), 6 deletions(-) diff --git a/library/Cargo.lock b/library/Cargo.lock index e4b3839847b1a..48d5eae286921 100644 --- a/library/Cargo.lock +++ b/library/Cargo.lock @@ -88,6 +88,12 @@ dependencies = [ "windows-sys", ] +[[package]] +name = "foldhash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" + [[package]] name = "fortanix-sgx-abi" version = "0.6.1" @@ -119,10 +125,10 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.15.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" +version = "0.16.0" +source = "git+https://github.com/gaujay/hashbrown.git?branch=8-bits-tag#fcce069967e957305ec8098c5f1e8280e9ce7c5b" dependencies = [ + "foldhash", "rustc-std-workspace-alloc", "rustc-std-workspace-core", ] diff --git a/library/std/Cargo.toml b/library/std/Cargo.toml index d28a7f0b46022..c76a5691f4368 100644 --- a/library/std/Cargo.toml +++ b/library/std/Cargo.toml @@ -20,7 +20,7 @@ panic_unwind = { path = "../panic_unwind", optional = true } panic_abort = { path = "../panic_abort" } core = { path = "../core", public = true } unwind = { path = "../unwind" } -hashbrown = { version = "0.15", default-features = false, features = [ +hashbrown = { git = "https://github.com/gaujay/hashbrown.git", branch = "8-bits-tag", default-features = false, features = [ 'rustc-dep-of-std', ] } std_detect = { path = "../std_detect", public = true } diff --git a/library/std/src/collections/hash/map.rs b/library/std/src/collections/hash/map.rs index fc0fef620e3b6..b2900f1033e04 100644 --- a/library/std/src/collections/hash/map.rs +++ b/library/std/src/collections/hash/map.rs @@ -1051,7 +1051,7 @@ where K: Borrow, Q: Hash + Eq, { - self.base.get_many_mut(ks) + self.base.get_disjoint_mut(ks) } /// Attempts to get mutable references to `N` values in the map at once, without validating that @@ -1118,7 +1118,7 @@ where K: Borrow, Q: Hash + Eq, { - unsafe { self.base.get_many_unchecked_mut(ks) } + unsafe { self.base.get_disjoint_unchecked_mut(ks) } } /// Returns `true` if the map contains a value for the specified key. diff --git a/src/tools/tidy/src/deps.rs b/src/tools/tidy/src/deps.rs index e275d3042cbba..ac0426aef20eb 100644 --- a/src/tools/tidy/src/deps.rs +++ b/src/tools/tidy/src/deps.rs @@ -45,6 +45,7 @@ const LICENSES: &[&str] = &[ "Unlicense OR MIT", "Unlicense/MIT", "Zlib OR Apache-2.0 OR MIT", // tinyvec + "Zlib", // tidy-alphabetical-end ]; @@ -559,6 +560,7 @@ const PERMITTED_STDLIB_DEPENDENCIES: &[&str] = &[ "cfg-if", "compiler_builtins", "dlmalloc", + "foldhash", "fortanix-sgx-abi", "getopts", "gimli", diff --git a/src/tools/tidy/src/extdeps.rs b/src/tools/tidy/src/extdeps.rs index f75de13b45ceb..02109f3a6dcdd 100644 --- a/src/tools/tidy/src/extdeps.rs +++ b/src/tools/tidy/src/extdeps.rs @@ -11,6 +11,7 @@ const ALLOWED_SOURCES: &[&str] = &[ r#""registry+https://github.com/rust-lang/crates.io-index""#, // This is `rust_team_data` used by `site` in src/tools/rustc-perf, r#""git+https://github.com/rust-lang/team#a5260e76d3aa894c64c56e6ddc8545b9a98043ec""#, + r#""git+https://github.com/gaujay/hashbrown.git?branch=8-bits-tag#fcce069967e957305ec8098c5f1e8280e9ce7c5b""#, ]; /// Checks for external package sources. `root` is the path to the directory that contains the