Skip to content

std: Stabilize feature try_reserve_2 #95392

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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