about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPavel Grigorenko <GrigorenkoPV@ya.ru>2025-01-14 18:13:52 +0300
committerPavel Grigorenko <GrigorenkoPV@ya.ru>2025-01-25 01:09:37 +0300
commit2ecb40e04a3ff8aeefc470598d8ea51edc197b26 (patch)
tree6d0ca4ce31aa94f1a330b6ccdafba5bb12c82dd4
parent1e9b0177da38e3f421a3b9b1942f1777d166e06a (diff)
downloadrust-2ecb40e04a3ff8aeefc470598d8ea51edc197b26.tar.gz
rust-2ecb40e04a3ff8aeefc470598d8ea51edc197b26.zip
Stabilize `vec_pop_if`
-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 28e4217e303..494f2b7aadb 100644
--- a/library/alloc/src/lib.rs
+++ b/library/alloc/src/lib.rs
@@ -155,7 +155,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 88bd3f414ea..34aacd337b4 100644
--- a/library/alloc/src/vec/mod.rs
+++ b/library/alloc/src/vec/mod.rs
@@ -2518,8 +2518,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;
     ///
@@ -2527,7 +2525,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 d8364d750fa..733b2508f66 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)]