1
Fork 0

Auto merge of #92998 - Amanieu:hashbrown12, r=Mark-Simulacrum

Update hashbrown to 0.12.0

[Changelog](https://github.com/rust-lang/hashbrown/blob/master/CHANGELOG.md#v0120---2022-01-17)
This commit is contained in:
bors 2022-01-22 23:39:21 +00:00
commit 10c4c4afec
3 changed files with 29 additions and 10 deletions

View file

@ -1587,6 +1587,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e"
dependencies = [ dependencies = [
"ahash", "ahash",
]
[[package]]
name = "hashbrown"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8c21d40587b92fa6a6c6e3c1bdbf87d75511db5672f9c93175574b3a00df1758"
dependencies = [
"compiler_builtins", "compiler_builtins",
"rustc-std-workspace-alloc", "rustc-std-workspace-alloc",
"rustc-std-workspace-core", "rustc-std-workspace-core",
@ -1736,7 +1744,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5" checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5"
dependencies = [ dependencies = [
"autocfg", "autocfg",
"hashbrown", "hashbrown 0.11.2",
"serde", "serde",
] ]
@ -2411,7 +2419,7 @@ checksum = "7ce8b38d41f9f3618fc23f908faae61510f8d8ce2d99cbe910641e8f1971f084"
dependencies = [ dependencies = [
"crc32fast", "crc32fast",
"flate2", "flate2",
"hashbrown", "hashbrown 0.11.2",
"indexmap", "indexmap",
"memchr", "memchr",
] ]
@ -4814,7 +4822,7 @@ dependencies = [
"core", "core",
"dlmalloc", "dlmalloc",
"fortanix-sgx-abi", "fortanix-sgx-abi",
"hashbrown", "hashbrown 0.12.0",
"hermit-abi", "hermit-abi",
"libc", "libc",
"miniz_oxide", "miniz_oxide",
@ -5096,7 +5104,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dd95b4559c196987c8451b4e14d08a4c796c2844f9adf4d2a2dbc9b3142843be" checksum = "dd95b4559c196987c8451b4e14d08a4c796c2844f9adf4d2a2dbc9b3142843be"
dependencies = [ dependencies = [
"gimli 0.26.1", "gimli 0.26.1",
"hashbrown", "hashbrown 0.11.2",
"object 0.28.1", "object 0.28.1",
"tracing", "tracing",
] ]

View file

@ -19,7 +19,7 @@ libc = { version = "0.2.108", default-features = false, features = ['rustc-dep-o
compiler_builtins = { version = "0.1.66" } compiler_builtins = { version = "0.1.66" }
profiler_builtins = { path = "../profiler_builtins", optional = true } profiler_builtins = { path = "../profiler_builtins", optional = true }
unwind = { path = "../unwind" } unwind = { path = "../unwind" }
hashbrown = { version = "0.11", default-features = false, features = ['rustc-dep-of-std'] } hashbrown = { version = "0.12", default-features = false, features = ['rustc-dep-of-std'] }
std_detect = { path = "../stdarch/crates/std_detect", default-features = false, features = ['rustc-dep-of-std'] } std_detect = { path = "../stdarch/crates/std_detect", default-features = false, features = ['rustc-dep-of-std'] }
# Dependencies of the `backtrace` crate # Dependencies of the `backtrace` crate

View file

@ -817,6 +817,7 @@ fn test_retain() {
} }
#[test] #[test]
#[cfg_attr(target_os = "android", ignore)] // Android used in CI has a broken dlmalloc
fn test_try_reserve() { fn test_try_reserve() {
let mut empty_bytes: HashMap<u8, u8> = HashMap::new(); let mut empty_bytes: HashMap<u8, u8> = HashMap::new();
@ -828,11 +829,21 @@ fn test_try_reserve() {
"usize::MAX should trigger an overflow!" "usize::MAX should trigger an overflow!"
); );
assert_matches!( if let Err(AllocError { .. }) = empty_bytes.try_reserve(MAX_USIZE / 16).map_err(|e| e.kind()) {
empty_bytes.try_reserve(MAX_USIZE / 8).map_err(|e| e.kind()), } else {
Err(AllocError { .. }), // This may succeed if there is enough free memory. Attempt to
"usize::MAX / 8 should trigger an OOM!" // allocate a few more hashmaps to ensure the allocation will fail.
); let mut empty_bytes2: HashMap<u8, u8> = HashMap::new();
let _ = empty_bytes2.try_reserve(MAX_USIZE / 16);
let mut empty_bytes3: HashMap<u8, u8> = HashMap::new();
let _ = empty_bytes3.try_reserve(MAX_USIZE / 16);
let mut empty_bytes4: HashMap<u8, u8> = HashMap::new();
assert_matches!(
empty_bytes4.try_reserve(MAX_USIZE / 16).map_err(|e| e.kind()),
Err(AllocError { .. }),
"usize::MAX / 16 should trigger an OOM!"
);
}
} }
#[test] #[test]