Skip to content

Commit ee1f6db

Browse files
committed
Auto merge of rust-lang#90380 - Mark-Simulacrum:revert-89558-query-stable-lint, r=lcnr
Revert "Add rustc lint, warning when iterating over hashmaps" Fixes perf regressions introduced in rust-lang#90235 by temporarily reverting the relevant PR.
2 parents 8d0fea4 + bb81fab commit ee1f6db

File tree

2 files changed

+0
-20
lines changed

2 files changed

+0
-20
lines changed

std/src/collections/hash/map.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,6 @@ impl<K, V, S> HashMap<K, V, S> {
414414
/// println!("key: {} val: {}", key, val);
415415
/// }
416416
/// ```
417-
#[cfg_attr(not(bootstrap), rustc_lint_query_instability)]
418417
#[stable(feature = "rust1", since = "1.0.0")]
419418
pub fn iter(&self) -> Iter<'_, K, V> {
420419
Iter { base: self.base.iter() }
@@ -443,7 +442,6 @@ impl<K, V, S> HashMap<K, V, S> {
443442
/// println!("key: {} val: {}", key, val);
444443
/// }
445444
/// ```
446-
#[cfg_attr(not(bootstrap), rustc_lint_query_instability)]
447445
#[stable(feature = "rust1", since = "1.0.0")]
448446
pub fn iter_mut(&mut self) -> IterMut<'_, K, V> {
449447
IterMut { base: self.base.iter_mut() }
@@ -504,7 +502,6 @@ impl<K, V, S> HashMap<K, V, S> {
504502
/// assert!(a.is_empty());
505503
/// ```
506504
#[inline]
507-
#[cfg_attr(not(bootstrap), rustc_lint_query_instability)]
508505
#[stable(feature = "drain", since = "1.6.0")]
509506
pub fn drain(&mut self) -> Drain<'_, K, V> {
510507
Drain { base: self.base.drain() }
@@ -546,7 +543,6 @@ impl<K, V, S> HashMap<K, V, S> {
546543
/// assert_eq!(odds, vec![1, 3, 5, 7]);
547544
/// ```
548545
#[inline]
549-
#[cfg_attr(not(bootstrap), rustc_lint_query_instability)]
550546
#[unstable(feature = "hash_drain_filter", issue = "59618")]
551547
pub fn drain_filter<F>(&mut self, pred: F) -> DrainFilter<'_, K, V, F>
552548
where
@@ -953,7 +949,6 @@ where
953949
/// assert_eq!(map.len(), 4);
954950
/// ```
955951
#[inline]
956-
#[cfg_attr(not(bootstrap), rustc_lint_query_instability)]
957952
#[stable(feature = "retain_hash_collection", since = "1.18.0")]
958953
pub fn retain<F>(&mut self, f: F)
959954
where
@@ -983,7 +978,6 @@ where
983978
/// assert_eq!(vec, ["a", "b", "c"]);
984979
/// ```
985980
#[inline]
986-
#[cfg_attr(not(bootstrap), rustc_lint_query_instability)]
987981
#[stable(feature = "map_into_keys_values", since = "1.54.0")]
988982
pub fn into_keys(self) -> IntoKeys<K, V> {
989983
IntoKeys { inner: self.into_iter() }
@@ -1010,7 +1004,6 @@ where
10101004
/// assert_eq!(vec, [1, 2, 3]);
10111005
/// ```
10121006
#[inline]
1013-
#[cfg_attr(not(bootstrap), rustc_lint_query_instability)]
10141007
#[stable(feature = "map_into_keys_values", since = "1.54.0")]
10151008
pub fn into_values(self) -> IntoValues<K, V> {
10161009
IntoValues { inner: self.into_iter() }
@@ -1976,7 +1969,6 @@ impl<'a, K, V, S> IntoIterator for &'a HashMap<K, V, S> {
19761969
type IntoIter = Iter<'a, K, V>;
19771970

19781971
#[inline]
1979-
#[cfg_attr(not(bootstrap), rustc_lint_query_instability)]
19801972
fn into_iter(self) -> Iter<'a, K, V> {
19811973
self.iter()
19821974
}
@@ -1988,7 +1980,6 @@ impl<'a, K, V, S> IntoIterator for &'a mut HashMap<K, V, S> {
19881980
type IntoIter = IterMut<'a, K, V>;
19891981

19901982
#[inline]
1991-
#[cfg_attr(not(bootstrap), rustc_lint_query_instability)]
19921983
fn into_iter(self) -> IterMut<'a, K, V> {
19931984
self.iter_mut()
19941985
}
@@ -2017,7 +2008,6 @@ impl<K, V, S> IntoIterator for HashMap<K, V, S> {
20172008
/// let vec: Vec<(&str, i32)> = map.into_iter().collect();
20182009
/// ```
20192010
#[inline]
2020-
#[cfg_attr(not(bootstrap), rustc_lint_query_instability)]
20212011
fn into_iter(self) -> IntoIter<K, V> {
20222012
IntoIter { base: self.base.into_iter() }
20232013
}

std/src/collections/hash/set.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ impl<T, S> HashSet<T, S> {
185185
/// }
186186
/// ```
187187
#[inline]
188-
#[cfg_attr(not(bootstrap), rustc_lint_query_instability)]
189188
#[stable(feature = "rust1", since = "1.0.0")]
190189
pub fn iter(&self) -> Iter<'_, T> {
191190
Iter { base: self.base.iter() }
@@ -245,7 +244,6 @@ impl<T, S> HashSet<T, S> {
245244
/// assert!(set.is_empty());
246245
/// ```
247246
#[inline]
248-
#[cfg_attr(not(bootstrap), rustc_lint_query_instability)]
249247
#[stable(feature = "drain", since = "1.6.0")]
250248
pub fn drain(&mut self) -> Drain<'_, T> {
251249
Drain { base: self.base.drain() }
@@ -284,7 +282,6 @@ impl<T, S> HashSet<T, S> {
284282
/// assert_eq!(odds, vec![1, 3, 5, 7]);
285283
/// ```
286284
#[inline]
287-
#[cfg_attr(not(bootstrap), rustc_lint_query_instability)]
288285
#[unstable(feature = "hash_drain_filter", issue = "59618")]
289286
pub fn drain_filter<F>(&mut self, pred: F) -> DrainFilter<'_, T, F>
290287
where
@@ -509,7 +506,6 @@ where
509506
/// assert_eq!(diff, [4].iter().collect());
510507
/// ```
511508
#[inline]
512-
#[cfg_attr(not(bootstrap), rustc_lint_query_instability)]
513509
#[stable(feature = "rust1", since = "1.0.0")]
514510
pub fn difference<'a>(&'a self, other: &'a HashSet<T, S>) -> Difference<'a, T, S> {
515511
Difference { iter: self.iter(), other }
@@ -537,7 +533,6 @@ where
537533
/// assert_eq!(diff1, [1, 4].iter().collect());
538534
/// ```
539535
#[inline]
540-
#[cfg_attr(not(bootstrap), rustc_lint_query_instability)]
541536
#[stable(feature = "rust1", since = "1.0.0")]
542537
pub fn symmetric_difference<'a>(
543538
&'a self,
@@ -565,7 +560,6 @@ where
565560
/// assert_eq!(intersection, [2, 3].iter().collect());
566561
/// ```
567562
#[inline]
568-
#[cfg_attr(not(bootstrap), rustc_lint_query_instability)]
569563
#[stable(feature = "rust1", since = "1.0.0")]
570564
pub fn intersection<'a>(&'a self, other: &'a HashSet<T, S>) -> Intersection<'a, T, S> {
571565
if self.len() <= other.len() {
@@ -594,7 +588,6 @@ where
594588
/// assert_eq!(union, [1, 2, 3, 4].iter().collect());
595589
/// ```
596590
#[inline]
597-
#[cfg_attr(not(bootstrap), rustc_lint_query_instability)]
598591
#[stable(feature = "rust1", since = "1.0.0")]
599592
pub fn union<'a>(&'a self, other: &'a HashSet<T, S>) -> Union<'a, T, S> {
600593
if self.len() >= other.len() {
@@ -929,7 +922,6 @@ where
929922
/// set.retain(|&k| k % 2 == 0);
930923
/// assert_eq!(set.len(), 3);
931924
/// ```
932-
#[cfg_attr(not(bootstrap), rustc_lint_query_instability)]
933925
#[stable(feature = "retain_hash_collection", since = "1.18.0")]
934926
pub fn retain<F>(&mut self, f: F)
935927
where
@@ -1411,7 +1403,6 @@ impl<'a, T, S> IntoIterator for &'a HashSet<T, S> {
14111403
type IntoIter = Iter<'a, T>;
14121404

14131405
#[inline]
1414-
#[cfg_attr(not(bootstrap), rustc_lint_query_instability)]
14151406
fn into_iter(self) -> Iter<'a, T> {
14161407
self.iter()
14171408
}
@@ -1443,7 +1434,6 @@ impl<T, S> IntoIterator for HashSet<T, S> {
14431434
/// }
14441435
/// ```
14451436
#[inline]
1446-
#[cfg_attr(not(bootstrap), rustc_lint_query_instability)]
14471437
fn into_iter(self) -> IntoIter<T> {
14481438
IntoIter { base: self.base.into_iter() }
14491439
}

0 commit comments

Comments
 (0)