Skip to content

Commit

Permalink
std: Stabilize feature try_reserve_2
Browse files Browse the repository at this point in the history
Signed-off-by: Xuanwo <[email protected]>
  • Loading branch information
Xuanwo committed Jun 16, 2022
1 parent b31f9cc commit 324286f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
6 changes: 2 additions & 4 deletions library/alloc/src/collections/binary_heap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -978,7 +978,6 @@ impl<T> BinaryHeap<T> {
/// # Examples
///
/// ```
/// #![feature(try_reserve_2)]
/// use std::collections::BinaryHeap;
/// use std::collections::TryReserveError;
///
Expand All @@ -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)
}
Expand All @@ -1014,7 +1013,6 @@ impl<T> BinaryHeap<T> {
/// # Examples
///
/// ```
/// #![feature(try_reserve_2)]
/// use std::collections::BinaryHeap;
/// use std::collections::TryReserveError;
///
Expand All @@ -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)
}
Expand Down
6 changes: 2 additions & 4 deletions library/std/src/ffi/os_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,6 @@ impl OsString {
/// # Examples
///
/// ```
/// #![feature(try_reserve_2)]
/// use std::ffi::{OsStr, OsString};
/// use std::collections::TryReserveError;
///
Expand All @@ -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)
Expand Down Expand Up @@ -348,7 +347,6 @@ impl OsString {
/// # Examples
///
/// ```
/// #![feature(try_reserve_2)]
/// use std::ffi::{OsStr, OsString};
/// use std::collections::TryReserveError;
///
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions library/std/src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 324286f

Please sign in to comment.