Skip to content

Commit b516806

Browse files
authoredJun 17, 2022
Rollup merge of #95392 - Xuanwo:stablize_try_reserve_2, r=dtolnay
std: Stabilize feature try_reserve_2 This PR intends to stabilize feature `try_reserve_2`, closes #91789 This PR will also replace the previous PR: #95139
2 parents ecdd374 + 324286f commit b516806

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed
 

‎library/alloc/src/collections/binary_heap.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,6 @@ impl<T> BinaryHeap<T> {
978978
/// # Examples
979979
///
980980
/// ```
981-
/// #![feature(try_reserve_2)]
982981
/// use std::collections::BinaryHeap;
983982
/// use std::collections::TryReserveError;
984983
///
@@ -995,7 +994,7 @@ impl<T> BinaryHeap<T> {
995994
/// }
996995
/// # find_max_slow(&[1, 2, 3]).expect("why is the test harness OOMing on 12 bytes?");
997996
/// ```
998-
#[unstable(feature = "try_reserve_2", issue = "91789")]
997+
#[stable(feature = "try_reserve_2", since = "1.63.0")]
999998
pub fn try_reserve_exact(&mut self, additional: usize) -> Result<(), TryReserveError> {
1000999
self.data.try_reserve_exact(additional)
10011000
}
@@ -1014,7 +1013,6 @@ impl<T> BinaryHeap<T> {
10141013
/// # Examples
10151014
///
10161015
/// ```
1017-
/// #![feature(try_reserve_2)]
10181016
/// use std::collections::BinaryHeap;
10191017
/// use std::collections::TryReserveError;
10201018
///
@@ -1031,7 +1029,7 @@ impl<T> BinaryHeap<T> {
10311029
/// }
10321030
/// # find_max_slow(&[1, 2, 3]).expect("why is the test harness OOMing on 12 bytes?");
10331031
/// ```
1034-
#[unstable(feature = "try_reserve_2", issue = "91789")]
1032+
#[stable(feature = "try_reserve_2", since = "1.63.0")]
10351033
pub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
10361034
self.data.try_reserve(additional)
10371035
}

‎library/std/src/ffi/os_str.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,6 @@ impl OsString {
300300
/// # Examples
301301
///
302302
/// ```
303-
/// #![feature(try_reserve_2)]
304303
/// use std::ffi::{OsStr, OsString};
305304
/// use std::collections::TryReserveError;
306305
///
@@ -317,7 +316,7 @@ impl OsString {
317316
/// }
318317
/// # process_data("123").expect("why is the test harness OOMing on 3 bytes?");
319318
/// ```
320-
#[unstable(feature = "try_reserve_2", issue = "91789")]
319+
#[stable(feature = "try_reserve_2", since = "1.63.0")]
321320
#[inline]
322321
pub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
323322
self.inner.try_reserve(additional)
@@ -372,7 +371,6 @@ impl OsString {
372371
/// # Examples
373372
///
374373
/// ```
375-
/// #![feature(try_reserve_2)]
376374
/// use std::ffi::{OsStr, OsString};
377375
/// use std::collections::TryReserveError;
378376
///
@@ -389,7 +387,7 @@ impl OsString {
389387
/// }
390388
/// # process_data("123").expect("why is the test harness OOMing on 3 bytes?");
391389
/// ```
392-
#[unstable(feature = "try_reserve_2", issue = "91789")]
390+
#[stable(feature = "try_reserve_2", since = "1.63.0")]
393391
#[inline]
394392
pub fn try_reserve_exact(&mut self, additional: usize) -> Result<(), TryReserveError> {
395393
self.inner.try_reserve_exact(additional)

‎library/std/src/path.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1520,7 +1520,7 @@ impl PathBuf {
15201520
/// Invokes [`try_reserve`] on the underlying instance of [`OsString`].
15211521
///
15221522
/// [`try_reserve`]: OsString::try_reserve
1523-
#[unstable(feature = "try_reserve_2", issue = "91789")]
1523+
#[stable(feature = "try_reserve_2", since = "1.63.0")]
15241524
#[inline]
15251525
pub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> {
15261526
self.inner.try_reserve(additional)
@@ -1538,7 +1538,7 @@ impl PathBuf {
15381538
/// Invokes [`try_reserve_exact`] on the underlying instance of [`OsString`].
15391539
///
15401540
/// [`try_reserve_exact`]: OsString::try_reserve_exact
1541-
#[unstable(feature = "try_reserve_2", issue = "91789")]
1541+
#[stable(feature = "try_reserve_2", since = "1.63.0")]
15421542
#[inline]
15431543
pub fn try_reserve_exact(&mut self, additional: usize) -> Result<(), TryReserveError> {
15441544
self.inner.try_reserve_exact(additional)

0 commit comments

Comments
 (0)
Please sign in to comment.