about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2025-02-09 19:44:50 +0100
committerGitHub <noreply@github.com>2025-02-09 19:44:50 +0100
commitb83a30c1b6c04c366773cda0f42a78cf94c5158e (patch)
tree1d1d2a99f8dae97f6f79d130c275d87fcd670a85
parent124cc92199ffa924f6b4c7cc819a85b65e0c3984 (diff)
parent2ecb40e04a3ff8aeefc470598d8ea51edc197b26 (diff)
downloadrust-b83a30c1b6c04c366773cda0f42a78cf94c5158e.tar.gz
rust-b83a30c1b6c04c366773cda0f42a78cf94c5158e.zip
Rollup merge of #135488 - GrigorenkoPV:vec_pop_if, r=jhpratt
Stabilize `vec_pop_if`

Tracking issue: #122741

FCP completed in https://github.com/rust-lang/rust/issues/122741#issuecomment-2605116387
-rw-r--r--library/alloc/src/lib.rs1
-rw-r--r--library/alloc/src/vec/mod.rs4
-rw-r--r--library/alloc/tests/lib.rs1
3 files changed, 1 insertions, 5 deletions
diff --git a/library/alloc/src/lib.rs b/library/alloc/src/lib.rs
index 0bb7c432cc3..1bb0f761064 100644
--- a/library/alloc/src/lib.rs
+++ b/library/alloc/src/lib.rs
@@ -156,7 +156,6 @@
 #![feature(unicode_internals)]
 #![feature(unsize)]
 #![feature(unwrap_infallible)]
-#![feature(vec_pop_if)]
 // tidy-alphabetical-end
 //
 // Language features:
diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs
index 48afcf6e064..55cd0569538 100644
--- a/library/alloc/src/vec/mod.rs
+++ b/library/alloc/src/vec/mod.rs
@@ -2519,8 +2519,6 @@ impl<T, A: Allocator> Vec<T, A> {
     /// # Examples
     ///
     /// ```
-    /// #![feature(vec_pop_if)]
-    ///
     /// let mut vec = vec![1, 2, 3, 4];
     /// let pred = |x: &mut i32| *x % 2 == 0;
     ///
@@ -2528,7 +2526,7 @@ impl<T, A: Allocator> Vec<T, A> {
     /// assert_eq!(vec, [1, 2, 3]);
     /// assert_eq!(vec.pop_if(pred), None);
     /// ```
-    #[unstable(feature = "vec_pop_if", issue = "122741")]
+    #[stable(feature = "vec_pop_if", since = "CURRENT_RUSTC_VERSION")]
     pub fn pop_if(&mut self, predicate: impl FnOnce(&mut T) -> bool) -> Option<T> {
         let last = self.last_mut()?;
         if predicate(last) { self.pop() } else { None }
diff --git a/library/alloc/tests/lib.rs b/library/alloc/tests/lib.rs
index 391ff04a4b8..1bcec4037cd 100644
--- a/library/alloc/tests/lib.rs
+++ b/library/alloc/tests/lib.rs
@@ -37,7 +37,6 @@
 #![feature(local_waker)]
 #![feature(str_as_str)]
 #![feature(strict_provenance_lints)]
-#![feature(vec_pop_if)]
 #![feature(vec_deque_pop_if)]
 #![feature(unique_rc_arc)]
 #![feature(macro_metavar_expr_concat)]