Skip to content

Commit 6223aa0

Browse files
GrigorenkoPVgitbot
authored and
gitbot
committed
Stabilize hash_extract_if
1 parent 062ca74 commit 6223aa0

File tree

2 files changed

+10
-16
lines changed

2 files changed

+10
-16
lines changed

std/src/collections/hash/map.rs

+5-8
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,6 @@ impl<K, V, S> HashMap<K, V, S> {
659659
/// Splitting a map into even and odd keys, reusing the original map:
660660
///
661661
/// ```
662-
/// #![feature(hash_extract_if)]
663662
/// use std::collections::HashMap;
664663
///
665664
/// let mut map: HashMap<i32, i32> = (0..8).map(|x| (x, x)).collect();
@@ -675,7 +674,7 @@ impl<K, V, S> HashMap<K, V, S> {
675674
/// ```
676675
#[inline]
677676
#[rustc_lint_query_instability]
678-
#[unstable(feature = "hash_extract_if", issue = "59618")]
677+
#[stable(feature = "hash_extract_if", since = "CURRENT_RUSTC_VERSION")]
679678
pub fn extract_if<F>(&mut self, pred: F) -> ExtractIf<'_, K, V, F>
680679
where
681680
F: FnMut(&K, &mut V) -> bool,
@@ -1718,16 +1717,14 @@ impl<'a, K, V> Drain<'a, K, V> {
17181717
/// # Example
17191718
///
17201719
/// ```
1721-
/// #![feature(hash_extract_if)]
1722-
///
17231720
/// use std::collections::HashMap;
17241721
///
17251722
/// let mut map = HashMap::from([
17261723
/// ("a", 1),
17271724
/// ]);
17281725
/// let iter = map.extract_if(|_k, v| *v % 2 == 0);
17291726
/// ```
1730-
#[unstable(feature = "hash_extract_if", issue = "59618")]
1727+
#[stable(feature = "hash_extract_if", since = "CURRENT_RUSTC_VERSION")]
17311728
#[must_use = "iterators are lazy and do nothing unless consumed"]
17321729
pub struct ExtractIf<'a, K, V, F>
17331730
where
@@ -2742,7 +2739,7 @@ where
27422739
}
27432740
}
27442741

2745-
#[unstable(feature = "hash_extract_if", issue = "59618")]
2742+
#[stable(feature = "hash_extract_if", since = "CURRENT_RUSTC_VERSION")]
27462743
impl<K, V, F> Iterator for ExtractIf<'_, K, V, F>
27472744
where
27482745
F: FnMut(&K, &mut V) -> bool,
@@ -2759,10 +2756,10 @@ where
27592756
}
27602757
}
27612758

2762-
#[unstable(feature = "hash_extract_if", issue = "59618")]
2759+
#[stable(feature = "hash_extract_if", since = "CURRENT_RUSTC_VERSION")]
27632760
impl<K, V, F> FusedIterator for ExtractIf<'_, K, V, F> where F: FnMut(&K, &mut V) -> bool {}
27642761

2765-
#[unstable(feature = "hash_extract_if", issue = "59618")]
2762+
#[stable(feature = "hash_extract_if", since = "CURRENT_RUSTC_VERSION")]
27662763
impl<'a, K, V, F> fmt::Debug for ExtractIf<'a, K, V, F>
27672764
where
27682765
F: FnMut(&K, &mut V) -> bool,

std/src/collections/hash/set.rs

+5-8
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,6 @@ impl<T, S> HashSet<T, S> {
293293
/// Splitting a set into even and odd values, reusing the original set:
294294
///
295295
/// ```
296-
/// #![feature(hash_extract_if)]
297296
/// use std::collections::HashSet;
298297
///
299298
/// let mut set: HashSet<i32> = (0..8).collect();
@@ -309,7 +308,7 @@ impl<T, S> HashSet<T, S> {
309308
/// ```
310309
#[inline]
311310
#[rustc_lint_query_instability]
312-
#[unstable(feature = "hash_extract_if", issue = "59618")]
311+
#[stable(feature = "hash_extract_if", since = "CURRENT_RUSTC_VERSION")]
313312
pub fn extract_if<F>(&mut self, pred: F) -> ExtractIf<'_, T, F>
314313
where
315314
F: FnMut(&T) -> bool,
@@ -1383,15 +1382,13 @@ pub struct Drain<'a, K: 'a> {
13831382
/// # Examples
13841383
///
13851384
/// ```
1386-
/// #![feature(hash_extract_if)]
1387-
///
13881385
/// use std::collections::HashSet;
13891386
///
13901387
/// let mut a = HashSet::from([1, 2, 3]);
13911388
///
13921389
/// let mut extract_ifed = a.extract_if(|v| v % 2 == 0);
13931390
/// ```
1394-
#[unstable(feature = "hash_extract_if", issue = "59618")]
1391+
#[stable(feature = "hash_extract_if", since = "CURRENT_RUSTC_VERSION")]
13951392
pub struct ExtractIf<'a, K, F>
13961393
where
13971394
F: FnMut(&K) -> bool,
@@ -1674,7 +1671,7 @@ impl<K: fmt::Debug> fmt::Debug for Drain<'_, K> {
16741671
}
16751672
}
16761673

1677-
#[unstable(feature = "hash_extract_if", issue = "59618")]
1674+
#[stable(feature = "hash_extract_if", since = "CURRENT_RUSTC_VERSION")]
16781675
impl<K, F> Iterator for ExtractIf<'_, K, F>
16791676
where
16801677
F: FnMut(&K) -> bool,
@@ -1691,10 +1688,10 @@ where
16911688
}
16921689
}
16931690

1694-
#[unstable(feature = "hash_extract_if", issue = "59618")]
1691+
#[stable(feature = "hash_extract_if", since = "CURRENT_RUSTC_VERSION")]
16951692
impl<K, F> FusedIterator for ExtractIf<'_, K, F> where F: FnMut(&K) -> bool {}
16961693

1697-
#[unstable(feature = "hash_extract_if", issue = "59618")]
1694+
#[stable(feature = "hash_extract_if", since = "CURRENT_RUSTC_VERSION")]
16981695
impl<'a, K, F> fmt::Debug for ExtractIf<'a, K, F>
16991696
where
17001697
F: FnMut(&K) -> bool,

0 commit comments

Comments
 (0)