std: Stabilize feature try_reserve_2

Signed-off-by: Xuanwo <github@xuanwo.io>
This commit is contained in:
Xuanwo 2022-03-28 10:01:59 +08:00
parent b31f9cc22b
commit 324286f101
No known key found for this signature in database
GPG Key ID: C423B4FA6B48E945
3 changed files with 6 additions and 10 deletions

View File

@ -978,7 +978,6 @@ impl<T> BinaryHeap<T> {
/// # Examples
///
/// ```
/// #![feature(try_reserve_2)]
/// use std::collections::BinaryHeap;
/// use std::collections::TryReserveError;
///
@ -995,7 +994,7 @@ impl<T> BinaryHeap<T> {
/// }
/// # 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 @@ impl<T> BinaryHeap<T> {
/// # Examples
///
/// ```
/// #![feature(try_reserve_2)]
/// use std::collections::BinaryHeap;
/// use std::collections::TryReserveError;
///
@ -1031,7 +1029,7 @@ impl<T> BinaryHeap<T> {
/// }
/// # 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)
}

View File

@ -280,7 +280,6 @@ impl OsString {
/// # Examples
///
/// ```
/// #![feature(try_reserve_2)]
/// use std::ffi::{OsStr, OsString};
/// use std::collections::TryReserveError;
///
@ -297,7 +296,7 @@ impl OsString {
/// }
/// # 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 @@ impl OsString {
/// # Examples
///
/// ```
/// #![feature(try_reserve_2)]
/// use std::ffi::{OsStr, OsString};
/// use std::collections::TryReserveError;
///
@ -365,7 +363,7 @@ impl OsString {
/// }
/// # 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)

View File

@ -1520,7 +1520,7 @@ impl PathBuf {
/// 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 @@ impl PathBuf {
/// 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)