Skip to content

Commit 5c32571

Browse files
matthiaskrgrgitbot
authored and
gitbot
committed
Rollup merge of rust-lang#135488 - GrigorenkoPV:vec_pop_if, r=jhpratt
Stabilize `vec_pop_if` Tracking issue: rust-lang#122741 FCP completed in rust-lang#122741 (comment)
2 parents 8b1cc57 + 99148f7 commit 5c32571

File tree

3 files changed

+1
-5
lines changed

3 files changed

+1
-5
lines changed

Diff for: alloc/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@
156156
#![feature(unicode_internals)]
157157
#![feature(unsize)]
158158
#![feature(unwrap_infallible)]
159-
#![feature(vec_pop_if)]
160159
// tidy-alphabetical-end
161160
//
162161
// Language features:

Diff for: alloc/src/vec/mod.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -2519,16 +2519,14 @@ impl<T, A: Allocator> Vec<T, A> {
25192519
/// # Examples
25202520
///
25212521
/// ```
2522-
/// #![feature(vec_pop_if)]
2523-
///
25242522
/// let mut vec = vec![1, 2, 3, 4];
25252523
/// let pred = |x: &mut i32| *x % 2 == 0;
25262524
///
25272525
/// assert_eq!(vec.pop_if(pred), Some(4));
25282526
/// assert_eq!(vec, [1, 2, 3]);
25292527
/// assert_eq!(vec.pop_if(pred), None);
25302528
/// ```
2531-
#[unstable(feature = "vec_pop_if", issue = "122741")]
2529+
#[stable(feature = "vec_pop_if", since = "CURRENT_RUSTC_VERSION")]
25322530
pub fn pop_if(&mut self, predicate: impl FnOnce(&mut T) -> bool) -> Option<T> {
25332531
let last = self.last_mut()?;
25342532
if predicate(last) { self.pop() } else { None }

Diff for: alloc/tests/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
#![feature(local_waker)]
3838
#![feature(str_as_str)]
3939
#![feature(strict_provenance_lints)]
40-
#![feature(vec_pop_if)]
4140
#![feature(vec_deque_pop_if)]
4241
#![feature(unique_rc_arc)]
4342
#![feature(macro_metavar_expr_concat)]

0 commit comments

Comments
 (0)