Skip to content

Commit

Permalink
[Clippy] Swap iter_over_hash_type to use diagnostic items instead o…
Browse files Browse the repository at this point in the history
…f paths
  • Loading branch information
GnomedDev committed Sep 19, 2024
1 parent 8147cf4 commit 04bd505
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions std/src/collections/hash/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1393,6 +1393,7 @@ where
/// let iter = map.iter();
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(not(test), rustc_diagnostic_item = "hashmap_iter_ty")]
pub struct Iter<'a, K: 'a, V: 'a> {
base: base::Iter<'a, K, V>,
}
Expand Down Expand Up @@ -1431,6 +1432,7 @@ impl<K: Debug, V: Debug> fmt::Debug for Iter<'_, K, V> {
/// let iter = map.iter_mut();
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(not(test), rustc_diagnostic_item = "hashmap_iter_mut_ty")]
pub struct IterMut<'a, K: 'a, V: 'a> {
base: base::IterMut<'a, K, V>,
}
Expand Down Expand Up @@ -1491,6 +1493,7 @@ impl<K, V> IntoIter<K, V> {
/// let iter_keys = map.keys();
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(not(test), rustc_diagnostic_item = "hashmap_keys_ty")]
pub struct Keys<'a, K: 'a, V: 'a> {
inner: Iter<'a, K, V>,
}
Expand Down Expand Up @@ -1529,6 +1532,7 @@ impl<K: Debug, V> fmt::Debug for Keys<'_, K, V> {
/// let iter_values = map.values();
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(not(test), rustc_diagnostic_item = "hashmap_values_ty")]
pub struct Values<'a, K: 'a, V: 'a> {
inner: Iter<'a, K, V>,
}
Expand Down Expand Up @@ -1567,6 +1571,7 @@ impl<K, V: Debug> fmt::Debug for Values<'_, K, V> {
/// let iter = map.drain();
/// ```
#[stable(feature = "drain", since = "1.6.0")]
#[cfg_attr(not(test), rustc_diagnostic_item = "hashmap_drain_ty")]
pub struct Drain<'a, K: 'a, V: 'a> {
base: base::Drain<'a, K, V>,
}
Expand Down Expand Up @@ -1624,6 +1629,7 @@ where
/// let iter_values = map.values_mut();
/// ```
#[stable(feature = "map_values_mut", since = "1.10.0")]
#[cfg_attr(not(test), rustc_diagnostic_item = "hashmap_values_mut_ty")]
pub struct ValuesMut<'a, K: 'a, V: 'a> {
inner: IterMut<'a, K, V>,
}
Expand Down
2 changes: 2 additions & 0 deletions std/src/collections/hash/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1271,6 +1271,7 @@ where
/// let mut iter = a.iter();
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(not(test), rustc_diagnostic_item = "hashset_iter_ty")]
pub struct Iter<'a, K: 'a> {
base: base::Iter<'a, K>,
}
Expand Down Expand Up @@ -1313,6 +1314,7 @@ pub struct IntoIter<K> {
/// let mut drain = a.drain();
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(not(test), rustc_diagnostic_item = "hashset_drain_ty")]
pub struct Drain<'a, K: 'a> {
base: base::Drain<'a, K>,
}
Expand Down

0 comments on commit 04bd505

Please sign in to comment.