From 324286f1019bcf9abef19543d4bb8749d9f91ed9 Mon Sep 17 00:00:00 2001 From: Xuanwo Date: Mon, 28 Mar 2022 10:01:59 +0800 Subject: [PATCH] std: Stabilize feature try_reserve_2 Signed-off-by: Xuanwo --- library/alloc/src/collections/binary_heap.rs | 6 ++---- library/std/src/ffi/os_str.rs | 6 ++---- library/std/src/path.rs | 4 ++-- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/library/alloc/src/collections/binary_heap.rs b/library/alloc/src/collections/binary_heap.rs index 839088eac21..3706300dcfe 100644 --- a/library/alloc/src/collections/binary_heap.rs +++ b/library/alloc/src/collections/binary_heap.rs @@ -978,7 +978,6 @@ pub fn reserve(&mut self, additional: usize) { /// # Examples /// /// ``` - /// #![feature(try_reserve_2)] /// use std::collections::BinaryHeap; /// use std::collections::TryReserveError; /// @@ -995,7 +994,7 @@ pub fn reserve(&mut self, additional: usize) { /// } /// # find_max_slow(&[1, 2, 3]).expect("why is the test harness OOMing on 12 bytes?"); /// ``` - #[unstable(feature = "try_reserve_2", issue = "91789")] + #[stable(feature = "try_reserve_2", since = "1.63.0")] pub fn try_reserve_exact(&mut self, additional: usize) -> Result<(), TryReserveError> { self.data.try_reserve_exact(additional) } @@ -1014,7 +1013,6 @@ pub fn try_reserve_exact(&mut self, additional: usize) -> Result<(), TryReserveE /// # Examples /// /// ``` - /// #![feature(try_reserve_2)] /// use std::collections::BinaryHeap; /// use std::collections::TryReserveError; /// @@ -1031,7 +1029,7 @@ pub fn try_reserve_exact(&mut self, additional: usize) -> Result<(), TryReserveE /// } /// # find_max_slow(&[1, 2, 3]).expect("why is the test harness OOMing on 12 bytes?"); /// ``` - #[unstable(feature = "try_reserve_2", issue = "91789")] + #[stable(feature = "try_reserve_2", since = "1.63.0")] pub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> { self.data.try_reserve(additional) } diff --git a/library/std/src/ffi/os_str.rs b/library/std/src/ffi/os_str.rs index 247bdd95458..bdc44771643 100644 --- a/library/std/src/ffi/os_str.rs +++ b/library/std/src/ffi/os_str.rs @@ -280,7 +280,6 @@ pub fn reserve(&mut self, additional: usize) { /// # Examples /// /// ``` - /// #![feature(try_reserve_2)] /// use std::ffi::{OsStr, OsString}; /// use std::collections::TryReserveError; /// @@ -297,7 +296,7 @@ pub fn reserve(&mut self, additional: usize) { /// } /// # process_data("123").expect("why is the test harness OOMing on 3 bytes?"); /// ``` - #[unstable(feature = "try_reserve_2", issue = "91789")] + #[stable(feature = "try_reserve_2", since = "1.63.0")] #[inline] pub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> { self.inner.try_reserve(additional) @@ -348,7 +347,6 @@ pub fn reserve_exact(&mut self, additional: usize) { /// # Examples /// /// ``` - /// #![feature(try_reserve_2)] /// use std::ffi::{OsStr, OsString}; /// use std::collections::TryReserveError; /// @@ -365,7 +363,7 @@ pub fn reserve_exact(&mut self, additional: usize) { /// } /// # process_data("123").expect("why is the test harness OOMing on 3 bytes?"); /// ``` - #[unstable(feature = "try_reserve_2", issue = "91789")] + #[stable(feature = "try_reserve_2", since = "1.63.0")] #[inline] pub fn try_reserve_exact(&mut self, additional: usize) -> Result<(), TryReserveError> { self.inner.try_reserve_exact(additional) diff --git a/library/std/src/path.rs b/library/std/src/path.rs index 36d6469c02d..6bbc8f55ace 100644 --- a/library/std/src/path.rs +++ b/library/std/src/path.rs @@ -1520,7 +1520,7 @@ pub fn reserve(&mut self, additional: usize) { /// Invokes [`try_reserve`] on the underlying instance of [`OsString`]. /// /// [`try_reserve`]: OsString::try_reserve - #[unstable(feature = "try_reserve_2", issue = "91789")] + #[stable(feature = "try_reserve_2", since = "1.63.0")] #[inline] pub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> { self.inner.try_reserve(additional) @@ -1538,7 +1538,7 @@ pub fn reserve_exact(&mut self, additional: usize) { /// Invokes [`try_reserve_exact`] on the underlying instance of [`OsString`]. /// /// [`try_reserve_exact`]: OsString::try_reserve_exact - #[unstable(feature = "try_reserve_2", issue = "91789")] + #[stable(feature = "try_reserve_2", since = "1.63.0")] #[inline] pub fn try_reserve_exact(&mut self, additional: usize) -> Result<(), TryReserveError> { self.inner.try_reserve_exact(additional) -- 2.44.0