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/alloc/src/collections | |
| parent | 003d8d3f56848b6f3833340e859b089a09aea36a (diff) | |
| parent | 00152d89776b632905cfa4ae58e594055298c9c8 (diff) | |
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/alloc/src/collections')
| -rw-r--r-- | library/alloc/src/collections/mod.rs | 4 | ||||
| -rw-r--r-- | library/alloc/src/collections/vec_deque/mod.rs | 6 |
2 files changed, 4 insertions, 6 deletions
diff --git a/library/alloc/src/collections/mod.rs b/library/alloc/src/collections/mod.rs index 4e31df8b4b8..77d28bdfe64 100644 --- a/library/alloc/src/collections/mod.rs +++ b/library/alloc/src/collections/mod.rs @@ -57,7 +57,7 @@ use core::fmt::Display; /// The error type for `try_reserve` methods. #[derive(Clone, PartialEq, Eq, Debug)] -#[unstable(feature = "try_reserve", reason = "new API", issue = "48043")] +#[stable(feature = "try_reserve", since = "1.57.0")] pub struct TryReserveError { kind: TryReserveErrorKind, } @@ -126,7 +126,7 @@ impl From<LayoutError> for TryReserveErrorKind { } } -#[unstable(feature = "try_reserve", reason = "new API", issue = "48043")] +#[stable(feature = "try_reserve", since = "1.57.0")] impl Display for TryReserveError { fn fmt( &self, diff --git a/library/alloc/src/collections/vec_deque/mod.rs b/library/alloc/src/collections/vec_deque/mod.rs index 007548ad1ab..f4de2b2ebe5 100644 --- a/library/alloc/src/collections/vec_deque/mod.rs +++ b/library/alloc/src/collections/vec_deque/mod.rs @@ -711,7 +711,6 @@ impl<T, A: Allocator> VecDeque<T, A> { /// # Examples /// /// ``` - /// #![feature(try_reserve)] /// use std::collections::TryReserveError; /// use std::collections::VecDeque; /// @@ -730,7 +729,7 @@ impl<T, A: Allocator> VecDeque<T, A> { /// } /// # process_data(&[1, 2, 3]).expect("why is the test harness OOMing on 12 bytes?"); /// ``` - #[unstable(feature = "try_reserve", reason = "new API", issue = "48043")] + #[stable(feature = "try_reserve", since = "1.57.0")] pub fn try_reserve_exact(&mut self, additional: usize) -> Result<(), TryReserveError> { self.try_reserve(additional) } @@ -749,7 +748,6 @@ impl<T, A: Allocator> VecDeque<T, A> { /// # Examples /// /// ``` - /// #![feature(try_reserve)] /// use std::collections::TryReserveError; /// use std::collections::VecDeque; /// @@ -768,7 +766,7 @@ impl<T, A: Allocator> VecDeque<T, A> { /// } /// # process_data(&[1, 2, 3]).expect("why is the test harness OOMing on 12 bytes?"); /// ``` - #[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> { let old_cap = self.cap(); let used_cap = self.len() + 1; |
