Skip to content

Commit 23e1132

Browse files
authored
Rollup merge of #134655 - GrigorenkoPV:hash_extract_if, r=cuviper
Stabilize `hash_extract_if` FCP complete: #59618 (comment) Tracking issue: #59618 Closes #59618
2 parents 617aad8 + 749065a commit 23e1132

File tree

2 files changed

+10
-16
lines changed

2 files changed

+10
-16
lines changed

library/std/src/collections/hash/map.rs

+5-8
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,6 @@ impl<K, V, S> HashMap<K, V, S> {
656656
/// Splitting a map into even and odd keys, reusing the original map:
657657
///
658658
/// ```
659-
/// #![feature(hash_extract_if)]
660659
/// use std::collections::HashMap;
661660
///
662661
/// let mut map: HashMap<i32, i32> = (0..8).map(|x| (x, x)).collect();
@@ -672,7 +671,7 @@ impl<K, V, S> HashMap<K, V, S> {
672671
/// ```
673672
#[inline]
674673
#[rustc_lint_query_instability]
675-
#[unstable(feature = "hash_extract_if", issue = "59618")]
674+
#[stable(feature = "hash_extract_if", since = "CURRENT_RUSTC_VERSION")]
676675
pub fn extract_if<F>(&mut self, pred: F) -> ExtractIf<'_, K, V, F>
677676
where
678677
F: FnMut(&K, &mut V) -> bool,
@@ -1722,16 +1721,14 @@ impl<'a, K, V> Drain<'a, K, V> {
17221721
/// # Example
17231722
///
17241723
/// ```
1725-
/// #![feature(hash_extract_if)]
1726-
///
17271724
/// use std::collections::HashMap;
17281725
///
17291726
/// let mut map = HashMap::from([
17301727
/// ("a", 1),
17311728
/// ]);
17321729
/// let iter = map.extract_if(|_k, v| *v % 2 == 0);
17331730
/// ```
1734-
#[unstable(feature = "hash_extract_if", issue = "59618")]
1731+
#[stable(feature = "hash_extract_if", since = "CURRENT_RUSTC_VERSION")]
17351732
#[must_use = "iterators are lazy and do nothing unless consumed"]
17361733
pub struct ExtractIf<'a, K, V, F>
17371734
where
@@ -2746,7 +2743,7 @@ where
27462743
}
27472744
}
27482745

2749-
#[unstable(feature = "hash_extract_if", issue = "59618")]
2746+
#[stable(feature = "hash_extract_if", since = "CURRENT_RUSTC_VERSION")]
27502747
impl<K, V, F> Iterator for ExtractIf<'_, K, V, F>
27512748
where
27522749
F: FnMut(&K, &mut V) -> bool,
@@ -2763,10 +2760,10 @@ where
27632760
}
27642761
}
27652762

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

2769-
#[unstable(feature = "hash_extract_if", issue = "59618")]
2766+
#[stable(feature = "hash_extract_if", since = "CURRENT_RUSTC_VERSION")]
27702767
impl<'a, K, V, F> fmt::Debug for ExtractIf<'a, K, V, F>
27712768
where
27722769
F: FnMut(&K, &mut V) -> bool,

library/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,
@@ -1385,15 +1384,13 @@ pub struct Drain<'a, K: 'a> {
13851384
/// # Examples
13861385
///
13871386
/// ```
1388-
/// #![feature(hash_extract_if)]
1389-
///
13901387
/// use std::collections::HashSet;
13911388
///
13921389
/// let mut a = HashSet::from([1, 2, 3]);
13931390
///
13941391
/// let mut extract_ifed = a.extract_if(|v| v % 2 == 0);
13951392
/// ```
1396-
#[unstable(feature = "hash_extract_if", issue = "59618")]
1393+
#[stable(feature = "hash_extract_if", since = "CURRENT_RUSTC_VERSION")]
13971394
pub struct ExtractIf<'a, K, F>
13981395
where
13991396
F: FnMut(&K) -> bool,
@@ -1676,7 +1673,7 @@ impl<K: fmt::Debug> fmt::Debug for Drain<'_, K> {
16761673
}
16771674
}
16781675

1679-
#[unstable(feature = "hash_extract_if", issue = "59618")]
1676+
#[stable(feature = "hash_extract_if", since = "CURRENT_RUSTC_VERSION")]
16801677
impl<K, F> Iterator for ExtractIf<'_, K, F>
16811678
where
16821679
F: FnMut(&K) -> bool,
@@ -1693,10 +1690,10 @@ where
16931690
}
16941691
}
16951692

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

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

0 commit comments

Comments
 (0)