Skip to content

Commit d058e12

Browse files
committed
Update hashbrown to version 0.15, with changes that were blocked by that release
1 parent 18b1161 commit d058e12

File tree

5 files changed

+9
-99
lines changed

5 files changed

+9
-99
lines changed

compiler/rustc_session/src/config/cfg.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ impl CheckCfg {
413413
] = self
414414
.expecteds
415415
.get_many_mut(VALUES)
416-
.expect("unable to get all the check-cfg values buckets");
416+
.map(|x| x.expect("unable to get all the check-cfg values buckets"));
417417

418418
for target in TARGETS
419419
.iter()

library/Cargo.lock

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This file is automatically @generated by Cargo.
22
# It is not intended for manual editing.
3-
version = 3
3+
version = 4
44

55
[[package]]
66
name = "addr2line"
@@ -42,9 +42,9 @@ checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f"
4242

4343
[[package]]
4444
name = "cc"
45-
version = "1.1.22"
45+
version = "1.1.24"
4646
source = "registry+https://github.com/rust-lang/crates.io-index"
47-
checksum = "9540e661f81799159abee814118cc139a2004b3a3aa3ea37724a1b66530b90e0"
47+
checksum = "812acba72f0a070b003d3697490d2b55b837230ae7c6c6497f05cc2ddbb8d938"
4848
dependencies = [
4949
"shlex",
5050
]
@@ -135,9 +135,9 @@ dependencies = [
135135

136136
[[package]]
137137
name = "hashbrown"
138-
version = "0.14.5"
138+
version = "0.15.0"
139139
source = "registry+https://github.com/rust-lang/crates.io-index"
140-
checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1"
140+
checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb"
141141
dependencies = [
142142
"allocator-api2",
143143
"compiler_builtins",

library/std/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ core = { path = "../core", public = true }
2020
compiler_builtins = { version = "0.1.130" }
2121
profiler_builtins = { path = "../profiler_builtins", optional = true }
2222
unwind = { path = "../unwind" }
23-
hashbrown = { version = "0.14", default-features = false, features = [
23+
hashbrown = { version = "0.15", default-features = false, features = [
2424
'rustc-dep-of-std',
2525
] }
2626
# FIXME(#127890): `object` depends on `memchr`, but `memchr` > v2.5 causes

library/std/src/collections/hash/map.rs

+2-60
Original file line numberDiff line numberDiff line change
@@ -952,7 +952,7 @@ where
952952
/// ```
953953
#[inline]
954954
#[unstable(feature = "map_many_mut", issue = "97601")]
955-
pub fn get_many_mut<Q: ?Sized, const N: usize>(&mut self, ks: [&Q; N]) -> Option<[&'_ mut V; N]>
955+
pub fn get_many_mut<Q: ?Sized, const N: usize>(&mut self, ks: [&Q; N]) -> [Option<&'_ mut V>; N]
956956
where
957957
K: Borrow<Q>,
958958
Q: Hash + Eq,
@@ -1011,7 +1011,7 @@ where
10111011
pub unsafe fn get_many_unchecked_mut<Q: ?Sized, const N: usize>(
10121012
&mut self,
10131013
ks: [&Q; N],
1014-
) -> Option<[&'_ mut V; N]>
1014+
) -> [Option<&'_ mut V>; N]
10151015
where
10161016
K: Borrow<Q>,
10171017
Q: Hash + Eq,
@@ -2978,64 +2978,6 @@ impl<'a, K, V> OccupiedEntry<'a, K, V> {
29782978
pub fn remove(self) -> V {
29792979
self.base.remove()
29802980
}
2981-
2982-
/// Replaces the entry, returning the old key and value. The new key in the hash map will be
2983-
/// the key used to create this entry.
2984-
///
2985-
/// # Examples
2986-
///
2987-
/// ```
2988-
/// #![feature(map_entry_replace)]
2989-
/// use std::collections::hash_map::{Entry, HashMap};
2990-
/// use std::rc::Rc;
2991-
///
2992-
/// let mut map: HashMap<Rc<String>, u32> = HashMap::new();
2993-
/// map.insert(Rc::new("Stringthing".to_string()), 15);
2994-
///
2995-
/// let my_key = Rc::new("Stringthing".to_string());
2996-
///
2997-
/// if let Entry::Occupied(entry) = map.entry(my_key) {
2998-
/// // Also replace the key with a handle to our other key.
2999-
/// let (old_key, old_value): (Rc<String>, u32) = entry.replace_entry(16);
3000-
/// }
3001-
///
3002-
/// ```
3003-
#[inline]
3004-
#[unstable(feature = "map_entry_replace", issue = "44286")]
3005-
pub fn replace_entry(self, value: V) -> (K, V) {
3006-
self.base.replace_entry(value)
3007-
}
3008-
3009-
/// Replaces the key in the hash map with the key used to create this entry.
3010-
///
3011-
/// # Examples
3012-
///
3013-
/// ```
3014-
/// #![feature(map_entry_replace)]
3015-
/// use std::collections::hash_map::{Entry, HashMap};
3016-
/// use std::rc::Rc;
3017-
///
3018-
/// let mut map: HashMap<Rc<String>, u32> = HashMap::new();
3019-
/// let known_strings: Vec<Rc<String>> = Vec::new();
3020-
///
3021-
/// // Initialise known strings, run program, etc.
3022-
///
3023-
/// reclaim_memory(&mut map, &known_strings);
3024-
///
3025-
/// fn reclaim_memory(map: &mut HashMap<Rc<String>, u32>, known_strings: &[Rc<String>] ) {
3026-
/// for s in known_strings {
3027-
/// if let Entry::Occupied(entry) = map.entry(Rc::clone(s)) {
3028-
/// // Replaces the entry's key with our version of it in `known_strings`.
3029-
/// entry.replace_key();
3030-
/// }
3031-
/// }
3032-
/// }
3033-
/// ```
3034-
#[inline]
3035-
#[unstable(feature = "map_entry_replace", issue = "44286")]
3036-
pub fn replace_key(self) -> K {
3037-
self.base.replace_key()
3038-
}
30392981
}
30402982

30412983
impl<'a, K: 'a, V: 'a> VacantEntry<'a, K, V> {

library/std/src/collections/hash/set.rs

-32
Original file line numberDiff line numberDiff line change
@@ -724,38 +724,6 @@ where
724724
self.base.get_or_insert(value)
725725
}
726726

727-
/// Inserts an owned copy of the given `value` into the set if it is not
728-
/// present, then returns a reference to the value in the set.
729-
///
730-
/// # Examples
731-
///
732-
/// ```
733-
/// #![feature(hash_set_entry)]
734-
///
735-
/// use std::collections::HashSet;
736-
///
737-
/// let mut set: HashSet<String> = ["cat", "dog", "horse"]
738-
/// .iter().map(|&pet| pet.to_owned()).collect();
739-
///
740-
/// assert_eq!(set.len(), 3);
741-
/// for &pet in &["cat", "dog", "fish"] {
742-
/// let value = set.get_or_insert_owned(pet);
743-
/// assert_eq!(value, pet);
744-
/// }
745-
/// assert_eq!(set.len(), 4); // a new "fish" was inserted
746-
/// ```
747-
#[inline]
748-
#[unstable(feature = "hash_set_entry", issue = "60896")]
749-
pub fn get_or_insert_owned<Q: ?Sized>(&mut self, value: &Q) -> &T
750-
where
751-
T: Borrow<Q>,
752-
Q: Hash + Eq + ToOwned<Owned = T>,
753-
{
754-
// Although the raw entry gives us `&mut T`, we only return `&T` to be consistent with
755-
// `get`. Key mutation is "raw" because you're not supposed to affect `Eq` or `Hash`.
756-
self.base.get_or_insert_owned(value)
757-
}
758-
759727
/// Inserts a value computed from `f` into the set if the given `value` is
760728
/// not present, then returns a reference to the value in the set.
761729
///

0 commit comments

Comments
 (0)