diff options
| author | Kornel <kornel@geekhood.net> | 2021-08-29 23:21:33 +0100 |
|---|---|---|
| committer | Kornel <kornel@geekhood.net> | 2021-10-04 10:29:46 +0100 |
| commit | 00152d89776b632905cfa4ae58e594055298c9c8 (patch) | |
| tree | 7f347d15c16ced00aae3c3bd65e230295a3b1acf /library/alloc | |
| parent | d25de31a0eeb14ab0c8c4613496fe2d3d9a085dd (diff) | |
Stabilize try_reserve
Diffstat (limited to 'library/alloc')
| -rw-r--r-- | library/alloc/src/collections/mod.rs | 4 | ||||
| -rw-r--r-- | library/alloc/src/collections/vec_deque/mod.rs | 6 | ||||
| -rw-r--r-- | library/alloc/src/string.rs | 6 | ||||
| -rw-r--r-- | library/alloc/src/vec/mod.rs | 6 | ||||
| -rw-r--r-- | library/alloc/tests/lib.rs | 1 |
5 files changed, 8 insertions, 15 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 4a2b0b33bf2..081a695f68a 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; diff --git a/library/alloc/src/string.rs b/library/alloc/src/string.rs index 92a17cc75ef..d88b8e39898 100644 --- a/library/alloc/src/string.rs +++ b/library/alloc/src/string.rs @@ -1009,7 +1009,6 @@ impl String { /// # Examples /// /// ``` - /// #![feature(try_reserve)] /// use std::collections::TryReserveError; /// /// fn process_data(data: &str) -> Result<String, TryReserveError> { @@ -1025,7 +1024,7 @@ impl String { /// } /// # process_data("rust").expect("why is the test harness OOMing on 4 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> { self.vec.try_reserve(additional) } @@ -1049,7 +1048,6 @@ impl String { /// # Examples /// /// ``` - /// #![feature(try_reserve)] /// use std::collections::TryReserveError; /// /// fn process_data(data: &str) -> Result<String, TryReserveError> { @@ -1065,7 +1063,7 @@ impl String { /// } /// # process_data("rust").expect("why is the test harness OOMing on 4 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.vec.try_reserve_exact(additional) } diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs index f3a30d09825..8db2c16d11e 100644 --- a/library/alloc/src/vec/mod.rs +++ b/library/alloc/src/vec/mod.rs @@ -849,7 +849,6 @@ impl<T, A: Allocator> Vec<T, A> { /// # Examples /// /// ``` - /// #![feature(try_reserve)] /// use std::collections::TryReserveError; /// /// fn process_data(data: &[u32]) -> Result<Vec<u32>, TryReserveError> { @@ -867,7 +866,7 @@ impl<T, A: Allocator> Vec<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> { self.buf.try_reserve(self.len, additional) } @@ -892,7 +891,6 @@ impl<T, A: Allocator> Vec<T, A> { /// # Examples /// /// ``` - /// #![feature(try_reserve)] /// use std::collections::TryReserveError; /// /// fn process_data(data: &[u32]) -> Result<Vec<u32>, TryReserveError> { @@ -910,7 +908,7 @@ impl<T, A: Allocator> Vec<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.buf.try_reserve_exact(self.len, additional) } diff --git a/library/alloc/tests/lib.rs b/library/alloc/tests/lib.rs index cae4dae708e..dfd3f4ccb39 100644 --- a/library/alloc/tests/lib.rs +++ b/library/alloc/tests/lib.rs @@ -8,7 +8,6 @@ #![feature(new_uninit)] #![feature(pattern)] #![feature(trusted_len)] -#![feature(try_reserve)] #![feature(try_reserve_kind)] #![feature(unboxed_closures)] #![feature(associated_type_bounds)] |
