diff options
| author | bors <bors@rust-lang.org> | 2021-12-21 09:01:25 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-12-21 09:01:25 +0000 |
| commit | 3d57c61a9e04dcd3df633f41142009d6dcad4399 (patch) | |
| tree | cb2777e279adb1b6b1f6d38baa1e4b4782e142e1 /library/std/src | |
| parent | 87e8639d8dd900ebdd79e9f0491ca4ae40944f02 (diff) | |
| parent | ee45a532f30dc8d6f373b952f09a265d979a2083 (diff) | |
Auto merge of #92152 - matthiaskrgr:rollup-nmskpw6, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - #90345 (Stabilise entry_insert) - #91412 (Improve suggestions for importing out-of-scope traits reexported as `_`) - #91770 (Suggest adding a `#[cfg(test)]` to to a test module) - #91823 (Make `PTR::as_ref` and similar methods `const`.) - #92127 (Move duplicates removal when generating results instead of when displaying them) - #92129 (JoinHandle docs: add missing 'the') - #92131 (Sync rustc_codegen_cranelift) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'library/std/src')
| -rw-r--r-- | library/std/src/collections/hash/map.rs | 12 | ||||
| -rw-r--r-- | library/std/src/thread/mod.rs | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/library/std/src/collections/hash/map.rs b/library/std/src/collections/hash/map.rs index 35f17aa781f..5ef23871e8b 100644 --- a/library/std/src/collections/hash/map.rs +++ b/library/std/src/collections/hash/map.rs @@ -2462,17 +2462,16 @@ impl<'a, K, V> Entry<'a, K, V> { /// # Examples /// /// ``` - /// #![feature(entry_insert)] /// use std::collections::HashMap; /// /// let mut map: HashMap<&str, String> = HashMap::new(); - /// let entry = map.entry("poneyland").insert("hoho".to_string()); + /// let entry = map.entry("poneyland").insert_entry("hoho".to_string()); /// /// assert_eq!(entry.key(), &"poneyland"); /// ``` #[inline] - #[unstable(feature = "entry_insert", issue = "65225")] - pub fn insert(self, value: V) -> OccupiedEntry<'a, K, V> { + #[stable(feature = "entry_insert", since = "1.59.0")] + pub fn insert_entry(self, value: V) -> OccupiedEntry<'a, K, V> { match self { Occupied(mut entry) => { entry.insert(value); @@ -2811,12 +2810,13 @@ impl<'a, K: 'a, V: 'a> VacantEntry<'a, K, V> { /// let mut map: HashMap<&str, u32> = HashMap::new(); /// /// if let Entry::Vacant(o) = map.entry("poneyland") { - /// o.insert(37); + /// o.insert_entry(37); /// } /// assert_eq!(map["poneyland"], 37); /// ``` #[inline] - fn insert_entry(self, value: V) -> OccupiedEntry<'a, K, V> { + #[stable(feature = "entry_insert", since = "1.59.0")] + pub fn insert_entry(self, value: V) -> OccupiedEntry<'a, K, V> { let base = self.base.insert_entry(value); OccupiedEntry { base } } diff --git a/library/std/src/thread/mod.rs b/library/std/src/thread/mod.rs index 64f6c7fa022..bcf2ec06022 100644 --- a/library/std/src/thread/mod.rs +++ b/library/std/src/thread/mod.rs @@ -1273,7 +1273,7 @@ impl<T> JoinInner<T> { /// An owned permission to join on a thread (block on its termination). /// /// A `JoinHandle` *detaches* the associated thread when it is dropped, which -/// means that there is no longer any handle to thread and no way to `join` +/// means that there is no longer any handle to the thread and no way to `join` /// on it. /// /// Due to platform restrictions, it is not possible to [`Clone`] this |
