Skip to content

Commit 2b1ecdf

Browse files
committed
add a rustc::query_stability lint
1 parent b59689f commit 2b1ecdf

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

std/src/collections/hash/map.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,7 @@ impl<K, V, S> HashMap<K, V, S> {
371371
/// assert_eq!(vec, ["a", "b", "c"]);
372372
/// ```
373373
#[inline]
374+
#[cfg_attr(not(bootstrap), rustc_lint_query_instability)]
374375
#[stable(feature = "map_into_keys_values", since = "1.54.0")]
375376
pub fn into_keys(self) -> IntoKeys<K, V> {
376377
IntoKeys { inner: self.into_iter() }
@@ -448,6 +449,7 @@ impl<K, V, S> HashMap<K, V, S> {
448449
/// assert_eq!(vec, [1, 2, 3]);
449450
/// ```
450451
#[inline]
452+
#[cfg_attr(not(bootstrap), rustc_lint_query_instability)]
451453
#[stable(feature = "map_into_keys_values", since = "1.54.0")]
452454
pub fn into_values(self) -> IntoValues<K, V> {
453455
IntoValues { inner: self.into_iter() }
@@ -471,6 +473,7 @@ impl<K, V, S> HashMap<K, V, S> {
471473
/// println!("key: {} val: {}", key, val);
472474
/// }
473475
/// ```
476+
#[cfg_attr(not(bootstrap), rustc_lint_query_instability)]
474477
#[stable(feature = "rust1", since = "1.0.0")]
475478
pub fn iter(&self) -> Iter<'_, K, V> {
476479
Iter { base: self.base.iter() }
@@ -500,6 +503,7 @@ impl<K, V, S> HashMap<K, V, S> {
500503
/// println!("key: {} val: {}", key, val);
501504
/// }
502505
/// ```
506+
#[cfg_attr(not(bootstrap), rustc_lint_query_instability)]
503507
#[stable(feature = "rust1", since = "1.0.0")]
504508
pub fn iter_mut(&mut self) -> IterMut<'_, K, V> {
505509
IterMut { base: self.base.iter_mut() }
@@ -560,6 +564,7 @@ impl<K, V, S> HashMap<K, V, S> {
560564
/// assert!(a.is_empty());
561565
/// ```
562566
#[inline]
567+
#[cfg_attr(not(bootstrap), rustc_lint_query_instability)]
563568
#[stable(feature = "drain", since = "1.6.0")]
564569
pub fn drain(&mut self) -> Drain<'_, K, V> {
565570
Drain { base: self.base.drain() }
@@ -601,6 +606,7 @@ impl<K, V, S> HashMap<K, V, S> {
601606
/// assert_eq!(odds, vec![1, 3, 5, 7]);
602607
/// ```
603608
#[inline]
609+
#[cfg_attr(not(bootstrap), rustc_lint_query_instability)]
604610
#[unstable(feature = "hash_drain_filter", issue = "59618")]
605611
pub fn drain_filter<F>(&mut self, pred: F) -> DrainFilter<'_, K, V, F>
606612
where
@@ -624,6 +630,7 @@ impl<K, V, S> HashMap<K, V, S> {
624630
/// assert_eq!(map.len(), 4);
625631
/// ```
626632
#[inline]
633+
#[cfg_attr(not(bootstrap), rustc_lint_query_instability)]
627634
#[stable(feature = "retain_hash_collection", since = "1.18.0")]
628635
pub fn retain<F>(&mut self, f: F)
629636
where
@@ -1990,6 +1997,7 @@ impl<'a, K, V, S> IntoIterator for &'a HashMap<K, V, S> {
19901997
type IntoIter = Iter<'a, K, V>;
19911998

19921999
#[inline]
2000+
#[cfg_attr(not(bootstrap), rustc_lint_query_instability)]
19932001
fn into_iter(self) -> Iter<'a, K, V> {
19942002
self.iter()
19952003
}
@@ -2001,6 +2009,7 @@ impl<'a, K, V, S> IntoIterator for &'a mut HashMap<K, V, S> {
20012009
type IntoIter = IterMut<'a, K, V>;
20022010

20032011
#[inline]
2012+
#[cfg_attr(not(bootstrap), rustc_lint_query_instability)]
20042013
fn into_iter(self) -> IterMut<'a, K, V> {
20052014
self.iter_mut()
20062015
}
@@ -2030,6 +2039,7 @@ impl<K, V, S> IntoIterator for HashMap<K, V, S> {
20302039
/// let vec: Vec<(&str, i32)> = map.into_iter().collect();
20312040
/// ```
20322041
#[inline]
2042+
#[cfg_attr(not(bootstrap), rustc_lint_query_instability)]
20332043
fn into_iter(self) -> IntoIter<K, V> {
20342044
IntoIter { base: self.base.into_iter() }
20352045
}

std/src/collections/hash/set.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ impl<T, S> HashSet<T, S> {
185185
/// }
186186
/// ```
187187
#[inline]
188+
#[cfg_attr(not(bootstrap), rustc_lint_query_instability)]
188189
#[stable(feature = "rust1", since = "1.0.0")]
189190
pub fn iter(&self) -> Iter<'_, T> {
190191
Iter { base: self.base.iter() }
@@ -244,6 +245,7 @@ impl<T, S> HashSet<T, S> {
244245
/// assert!(set.is_empty());
245246
/// ```
246247
#[inline]
248+
#[cfg_attr(not(bootstrap), rustc_lint_query_instability)]
247249
#[stable(feature = "drain", since = "1.6.0")]
248250
pub fn drain(&mut self) -> Drain<'_, T> {
249251
Drain { base: self.base.drain() }
@@ -282,6 +284,7 @@ impl<T, S> HashSet<T, S> {
282284
/// assert_eq!(odds, vec![1, 3, 5, 7]);
283285
/// ```
284286
#[inline]
287+
#[cfg_attr(not(bootstrap), rustc_lint_query_instability)]
285288
#[unstable(feature = "hash_drain_filter", issue = "59618")]
286289
pub fn drain_filter<F>(&mut self, pred: F) -> DrainFilter<'_, T, F>
287290
where
@@ -304,6 +307,7 @@ impl<T, S> HashSet<T, S> {
304307
/// set.retain(|&k| k % 2 == 0);
305308
/// assert_eq!(set.len(), 3);
306309
/// ```
310+
#[cfg_attr(not(bootstrap), rustc_lint_query_instability)]
307311
#[stable(feature = "retain_hash_collection", since = "1.18.0")]
308312
pub fn retain<F>(&mut self, f: F)
309313
where
@@ -528,6 +532,7 @@ where
528532
/// assert_eq!(diff, [4].iter().collect());
529533
/// ```
530534
#[inline]
535+
#[cfg_attr(not(bootstrap), rustc_lint_query_instability)]
531536
#[stable(feature = "rust1", since = "1.0.0")]
532537
pub fn difference<'a>(&'a self, other: &'a HashSet<T, S>) -> Difference<'a, T, S> {
533538
Difference { iter: self.iter(), other }
@@ -555,6 +560,7 @@ where
555560
/// assert_eq!(diff1, [1, 4].iter().collect());
556561
/// ```
557562
#[inline]
563+
#[cfg_attr(not(bootstrap), rustc_lint_query_instability)]
558564
#[stable(feature = "rust1", since = "1.0.0")]
559565
pub fn symmetric_difference<'a>(
560566
&'a self,
@@ -582,6 +588,7 @@ where
582588
/// assert_eq!(intersection, [2, 3].iter().collect());
583589
/// ```
584590
#[inline]
591+
#[cfg_attr(not(bootstrap), rustc_lint_query_instability)]
585592
#[stable(feature = "rust1", since = "1.0.0")]
586593
pub fn intersection<'a>(&'a self, other: &'a HashSet<T, S>) -> Intersection<'a, T, S> {
587594
if self.len() <= other.len() {
@@ -610,6 +617,7 @@ where
610617
/// assert_eq!(union, [1, 2, 3, 4].iter().collect());
611618
/// ```
612619
#[inline]
620+
#[cfg_attr(not(bootstrap), rustc_lint_query_instability)]
613621
#[stable(feature = "rust1", since = "1.0.0")]
614622
pub fn union<'a>(&'a self, other: &'a HashSet<T, S>) -> Union<'a, T, S> {
615623
if self.len() >= other.len() {
@@ -1410,6 +1418,7 @@ impl<'a, T, S> IntoIterator for &'a HashSet<T, S> {
14101418
type IntoIter = Iter<'a, T>;
14111419

14121420
#[inline]
1421+
#[cfg_attr(not(bootstrap), rustc_lint_query_instability)]
14131422
fn into_iter(self) -> Iter<'a, T> {
14141423
self.iter()
14151424
}
@@ -1441,6 +1450,7 @@ impl<T, S> IntoIterator for HashSet<T, S> {
14411450
/// }
14421451
/// ```
14431452
#[inline]
1453+
#[cfg_attr(not(bootstrap), rustc_lint_query_instability)]
14441454
fn into_iter(self) -> IntoIter<T> {
14451455
IntoIter { base: self.base.into_iter() }
14461456
}

0 commit comments

Comments
 (0)