diff options
| author | bors <bors@rust-lang.org> | 2021-10-24 14:12:10 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-10-24 14:12:10 +0000 |
| commit | 00d5e42e776da900049fe19087bc9b0057ec70cd (patch) | |
| tree | f168b0920764af97f372d7faa608611cd3f09f79 /library/std/src | |
| parent | ed08a67566d7d1d9dd2ad928ff21c23e841a4345 (diff) | |
| parent | eee29fd34c9fdc9afddfc3108d8e36199854f0b3 (diff) | |
| download | rust-00d5e42e776da900049fe19087bc9b0057ec70cd.tar.gz rust-00d5e42e776da900049fe19087bc9b0057ec70cd.zip | |
Auto merge of #90235 - matthiaskrgr:rollup-7pqtevk, r=matthiaskrgr
Rollup of 6 pull requests
Successful merges:
- #89558 (Add rustc lint, warning when iterating over hashmaps)
- #90100 (Skip documentation for tier 2 targets on dist-x86_64-apple-darwin)
- #90155 (Fix alignment of method headings for scannability)
- #90162 (Mark `{array, slice}::{from_ref, from_mut}` as const fn)
- #90221 (Fix ICE when forgetting to `Box` a parameter to a `Self::func` call)
- #90234 (Temporarily turn overflow checks off for rustc-rayon-core)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'library/std/src')
| -rw-r--r-- | library/std/src/collections/hash/map.rs | 10 | ||||
| -rw-r--r-- | library/std/src/collections/hash/set.rs | 10 |
2 files changed, 20 insertions, 0 deletions
diff --git a/library/std/src/collections/hash/map.rs b/library/std/src/collections/hash/map.rs index 01019344f4f..d36a3eaea92 100644 --- a/library/std/src/collections/hash/map.rs +++ b/library/std/src/collections/hash/map.rs @@ -414,6 +414,7 @@ impl<K, V, S> HashMap<K, V, S> { /// println!("key: {} val: {}", key, val); /// } /// ``` + #[cfg_attr(not(bootstrap), rustc_lint_query_instability)] #[stable(feature = "rust1", since = "1.0.0")] pub fn iter(&self) -> Iter<'_, K, V> { Iter { base: self.base.iter() } @@ -442,6 +443,7 @@ impl<K, V, S> HashMap<K, V, S> { /// println!("key: {} val: {}", key, val); /// } /// ``` + #[cfg_attr(not(bootstrap), rustc_lint_query_instability)] #[stable(feature = "rust1", since = "1.0.0")] pub fn iter_mut(&mut self) -> IterMut<'_, K, V> { IterMut { base: self.base.iter_mut() } @@ -502,6 +504,7 @@ impl<K, V, S> HashMap<K, V, S> { /// assert!(a.is_empty()); /// ``` #[inline] + #[cfg_attr(not(bootstrap), rustc_lint_query_instability)] #[stable(feature = "drain", since = "1.6.0")] pub fn drain(&mut self) -> Drain<'_, K, V> { Drain { base: self.base.drain() } @@ -543,6 +546,7 @@ impl<K, V, S> HashMap<K, V, S> { /// assert_eq!(odds, vec![1, 3, 5, 7]); /// ``` #[inline] + #[cfg_attr(not(bootstrap), rustc_lint_query_instability)] #[unstable(feature = "hash_drain_filter", issue = "59618")] pub fn drain_filter<F>(&mut self, pred: F) -> DrainFilter<'_, K, V, F> where @@ -949,6 +953,7 @@ where /// assert_eq!(map.len(), 4); /// ``` #[inline] + #[cfg_attr(not(bootstrap), rustc_lint_query_instability)] #[stable(feature = "retain_hash_collection", since = "1.18.0")] pub fn retain<F>(&mut self, f: F) where @@ -978,6 +983,7 @@ where /// assert_eq!(vec, ["a", "b", "c"]); /// ``` #[inline] + #[cfg_attr(not(bootstrap), rustc_lint_query_instability)] #[stable(feature = "map_into_keys_values", since = "1.54.0")] pub fn into_keys(self) -> IntoKeys<K, V> { IntoKeys { inner: self.into_iter() } @@ -1004,6 +1010,7 @@ where /// assert_eq!(vec, [1, 2, 3]); /// ``` #[inline] + #[cfg_attr(not(bootstrap), rustc_lint_query_instability)] #[stable(feature = "map_into_keys_values", since = "1.54.0")] pub fn into_values(self) -> IntoValues<K, V> { IntoValues { inner: self.into_iter() } @@ -1969,6 +1976,7 @@ impl<'a, K, V, S> IntoIterator for &'a HashMap<K, V, S> { type IntoIter = Iter<'a, K, V>; #[inline] + #[cfg_attr(not(bootstrap), rustc_lint_query_instability)] fn into_iter(self) -> Iter<'a, K, V> { self.iter() } @@ -1980,6 +1988,7 @@ impl<'a, K, V, S> IntoIterator for &'a mut HashMap<K, V, S> { type IntoIter = IterMut<'a, K, V>; #[inline] + #[cfg_attr(not(bootstrap), rustc_lint_query_instability)] fn into_iter(self) -> IterMut<'a, K, V> { self.iter_mut() } @@ -2008,6 +2017,7 @@ impl<K, V, S> IntoIterator for HashMap<K, V, S> { /// let vec: Vec<(&str, i32)> = map.into_iter().collect(); /// ``` #[inline] + #[cfg_attr(not(bootstrap), rustc_lint_query_instability)] fn into_iter(self) -> IntoIter<K, V> { IntoIter { base: self.base.into_iter() } } diff --git a/library/std/src/collections/hash/set.rs b/library/std/src/collections/hash/set.rs index 546c43faecf..76008e565b3 100644 --- a/library/std/src/collections/hash/set.rs +++ b/library/std/src/collections/hash/set.rs @@ -185,6 +185,7 @@ impl<T, S> HashSet<T, S> { /// } /// ``` #[inline] + #[cfg_attr(not(bootstrap), rustc_lint_query_instability)] #[stable(feature = "rust1", since = "1.0.0")] pub fn iter(&self) -> Iter<'_, T> { Iter { base: self.base.iter() } @@ -244,6 +245,7 @@ impl<T, S> HashSet<T, S> { /// assert!(set.is_empty()); /// ``` #[inline] + #[cfg_attr(not(bootstrap), rustc_lint_query_instability)] #[stable(feature = "drain", since = "1.6.0")] pub fn drain(&mut self) -> Drain<'_, T> { Drain { base: self.base.drain() } @@ -282,6 +284,7 @@ impl<T, S> HashSet<T, S> { /// assert_eq!(odds, vec![1, 3, 5, 7]); /// ``` #[inline] + #[cfg_attr(not(bootstrap), rustc_lint_query_instability)] #[unstable(feature = "hash_drain_filter", issue = "59618")] pub fn drain_filter<F>(&mut self, pred: F) -> DrainFilter<'_, T, F> where @@ -506,6 +509,7 @@ where /// assert_eq!(diff, [4].iter().collect()); /// ``` #[inline] + #[cfg_attr(not(bootstrap), rustc_lint_query_instability)] #[stable(feature = "rust1", since = "1.0.0")] pub fn difference<'a>(&'a self, other: &'a HashSet<T, S>) -> Difference<'a, T, S> { Difference { iter: self.iter(), other } @@ -533,6 +537,7 @@ where /// assert_eq!(diff1, [1, 4].iter().collect()); /// ``` #[inline] + #[cfg_attr(not(bootstrap), rustc_lint_query_instability)] #[stable(feature = "rust1", since = "1.0.0")] pub fn symmetric_difference<'a>( &'a self, @@ -560,6 +565,7 @@ where /// assert_eq!(intersection, [2, 3].iter().collect()); /// ``` #[inline] + #[cfg_attr(not(bootstrap), rustc_lint_query_instability)] #[stable(feature = "rust1", since = "1.0.0")] pub fn intersection<'a>(&'a self, other: &'a HashSet<T, S>) -> Intersection<'a, T, S> { if self.len() <= other.len() { @@ -588,6 +594,7 @@ where /// assert_eq!(union, [1, 2, 3, 4].iter().collect()); /// ``` #[inline] + #[cfg_attr(not(bootstrap), rustc_lint_query_instability)] #[stable(feature = "rust1", since = "1.0.0")] pub fn union<'a>(&'a self, other: &'a HashSet<T, S>) -> Union<'a, T, S> { if self.len() >= other.len() { @@ -922,6 +929,7 @@ where /// set.retain(|&k| k % 2 == 0); /// assert_eq!(set.len(), 3); /// ``` + #[cfg_attr(not(bootstrap), rustc_lint_query_instability)] #[stable(feature = "retain_hash_collection", since = "1.18.0")] pub fn retain<F>(&mut self, f: F) where @@ -1403,6 +1411,7 @@ impl<'a, T, S> IntoIterator for &'a HashSet<T, S> { type IntoIter = Iter<'a, T>; #[inline] + #[cfg_attr(not(bootstrap), rustc_lint_query_instability)] fn into_iter(self) -> Iter<'a, T> { self.iter() } @@ -1434,6 +1443,7 @@ impl<T, S> IntoIterator for HashSet<T, S> { /// } /// ``` #[inline] + #[cfg_attr(not(bootstrap), rustc_lint_query_instability)] fn into_iter(self) -> IntoIter<T> { IntoIter { base: self.base.into_iter() } } |
