diff options
| author | Jubilee <46493976+workingjubilee@users.noreply.github.com> | 2021-10-04 21:12:33 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-04 21:12:33 -0700 |
| commit | 99e6e3ff078162ffec3bb5fd810d54246add2196 (patch) | |
| tree | b4bbb5ab9b78e9aa8e4363ca4401f2a234601702 /library/std/src | |
| parent | 003d8d3f56848b6f3833340e859b089a09aea36a (diff) | |
| parent | 00152d89776b632905cfa4ae58e594055298c9c8 (diff) | |
| download | rust-99e6e3ff078162ffec3bb5fd810d54246add2196.tar.gz rust-99e6e3ff078162ffec3bb5fd810d54246add2196.zip | |
Rollup merge of #87993 - kornelski:try_reserve_stable, r=joshtriplett
Stabilize try_reserve Stabilization PR for the [`try_reserve` feature](https://github.com/rust-lang/rust/issues/48043#issuecomment-898040475).
Diffstat (limited to 'library/std/src')
| -rw-r--r-- | library/std/src/collections/hash/map.rs | 3 | ||||
| -rw-r--r-- | library/std/src/collections/hash/set.rs | 3 | ||||
| -rw-r--r-- | library/std/src/collections/mod.rs | 2 | ||||
| -rw-r--r-- | library/std/src/error.rs | 2 | ||||
| -rw-r--r-- | library/std/src/lib.rs | 1 |
5 files changed, 4 insertions, 7 deletions
diff --git a/library/std/src/collections/hash/map.rs b/library/std/src/collections/hash/map.rs index 2de16ce3f86..528bb1bf6e9 100644 --- a/library/std/src/collections/hash/map.rs +++ b/library/std/src/collections/hash/map.rs @@ -625,14 +625,13 @@ where /// # Examples /// /// ``` - /// #![feature(try_reserve)] /// use std::collections::HashMap; /// /// let mut map: HashMap<&str, isize> = HashMap::new(); /// map.try_reserve(10).expect("why is the test harness OOMing on 10 bytes?"); /// ``` #[inline] - #[unstable(feature = "try_reserve", reason = "new API", issue = "48043")] + #[stable(feature = "try_reserve", since = "1.57.0")] pub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> { self.base.try_reserve(additional).map_err(map_try_reserve_error) } diff --git a/library/std/src/collections/hash/set.rs b/library/std/src/collections/hash/set.rs index 2613fbce156..dcfe3220950 100644 --- a/library/std/src/collections/hash/set.rs +++ b/library/std/src/collections/hash/set.rs @@ -423,13 +423,12 @@ where /// # Examples /// /// ``` - /// #![feature(try_reserve)] /// use std::collections::HashSet; /// let mut set: HashSet<i32> = HashSet::new(); /// set.try_reserve(10).expect("why is the test harness OOMing on 10 bytes?"); /// ``` #[inline] - #[unstable(feature = "try_reserve", reason = "new API", issue = "48043")] + #[stable(feature = "try_reserve", since = "1.57.0")] pub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> { self.base.try_reserve(additional).map_err(map_try_reserve_error) } diff --git a/library/std/src/collections/mod.rs b/library/std/src/collections/mod.rs index 6ca0525cdbe..a19c3431989 100644 --- a/library/std/src/collections/mod.rs +++ b/library/std/src/collections/mod.rs @@ -420,7 +420,7 @@ pub use self::hash_map::HashMap; #[stable(feature = "rust1", since = "1.0.0")] pub use self::hash_set::HashSet; -#[unstable(feature = "try_reserve", reason = "new API", issue = "48043")] +#[stable(feature = "try_reserve", since = "1.57.0")] pub use alloc_crate::collections::TryReserveError; #[unstable( feature = "try_reserve_kind", diff --git a/library/std/src/error.rs b/library/std/src/error.rs index cc4ea27e57e..6ae0bc47a94 100644 --- a/library/std/src/error.rs +++ b/library/std/src/error.rs @@ -595,7 +595,7 @@ impl Error for char::ParseCharError { } } -#[unstable(feature = "try_reserve", reason = "new API", issue = "48043")] +#[stable(feature = "try_reserve", since = "1.57.0")] impl Error for alloc::collections::TryReserveError {} #[unstable(feature = "duration_checked_float", issue = "83400")] diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs index b33a3c5d22f..0ba4e85886c 100644 --- a/library/std/src/lib.rs +++ b/library/std/src/lib.rs @@ -331,7 +331,6 @@ #![feature(total_cmp)] #![feature(trace_macros)] #![feature(try_blocks)] -#![feature(try_reserve)] #![feature(try_reserve_kind)] #![feature(unboxed_closures)] #![feature(unwrap_infallible)] |
