Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 65e36d5

Browse files
committedJan 22, 2025
Stabilize vec_pop_if
1 parent b2728d5 commit 65e36d5

File tree

3 files changed

+2
-6
lines changed

3 files changed

+2
-6
lines changed
 

‎library/alloc/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@
153153
#![feature(unicode_internals)]
154154
#![feature(unsize)]
155155
#![feature(unwrap_infallible)]
156-
#![feature(vec_pop_if)]
157156
// tidy-alphabetical-end
158157
//
159158
// Language features:

‎library/alloc/src/vec/mod.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -2513,21 +2513,19 @@ impl<T, A: Allocator> Vec<T, A> {
25132513

25142514
/// Removes and returns the last element in a vector if the predicate
25152515
/// returns `true`, or [`None`] if the predicate returns false or the vector
2516-
/// is empty.
2516+
/// is empty (the predicate will not be called in that case).
25172517
///
25182518
/// # Examples
25192519
///
25202520
/// ```
2521-
/// #![feature(vec_pop_if)]
2522-
///
25232521
/// let mut vec = vec![1, 2, 3, 4];
25242522
/// let pred = |x: &mut i32| *x % 2 == 0;
25252523
///
25262524
/// assert_eq!(vec.pop_if(pred), Some(4));
25272525
/// assert_eq!(vec, [1, 2, 3]);
25282526
/// assert_eq!(vec.pop_if(pred), None);
25292527
/// ```
2530-
#[unstable(feature = "vec_pop_if", issue = "122741")]
2528+
#[stable(feature = "vec_pop_if", since = "CURRENT_RUSTC_VERSION")]
25312529
pub fn pop_if<F>(&mut self, f: F) -> Option<T>
25322530
where
25332531
F: FnOnce(&mut T) -> bool,

‎library/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(unique_rc_arc)]
4241
#![feature(macro_metavar_expr_concat)]
4342
#![allow(internal_features)]

0 commit comments

Comments
 (0)
Failed to load comments.