[Clippy] Swap manual_retain to use diagnostic items instead of paths · qinheping/verify-rust-std@ff51d9f (original) (raw)

7 files changed

lines changed

Original file line number Diff line number Diff line change
@@ -959,6 +959,7 @@ impl<T, A: Allocator> BinaryHeap<T, A> {
959 959 /// }
960 960 /// ```
961 961 #[stable(feature = "rust1", since = "1.0.0")]
962 +#[cfg_attr(not(test), rustc_diagnostic_item = "binaryheap_iter")]
962 963 pub fn iter(&self) -> Iter<'_, T> {
963 964 Iter { iter: self.data.iter() }
964 965 }
Original file line number Diff line number Diff line change
@@ -1132,6 +1132,7 @@ impl<T, A: Allocator + Clone> BTreeSet<T, A> {
1132 1132 /// assert_eq!(set_iter.next(), None);
1133 1133 /// ```
1134 1134 #[stable(feature = "rust1", since = "1.0.0")]
1135 +#[cfg_attr(not(test), rustc_diagnostic_item = "btreeset_iter")]
1135 1136 pub fn iter(&self) -> Iter<'_, T> {
1136 1137 Iter { iter: self.map.keys() }
1137 1138 }
Original file line number Diff line number Diff line change
@@ -1201,6 +1201,7 @@ impl<T, A: Allocator> VecDeque<T, A> {
1201 1201 /// assert_eq!(&c[..], b);
1202 1202 /// ```
1203 1203 #[stable(feature = "rust1", since = "1.0.0")]
1204 +#[cfg_attr(not(test), rustc_diagnostic_item = "vecdeque_iter")]
1204 1205 pub fn iter(&self) -> Iter<'_, T> {
1205 1206 let (a, b) = self.as_slices();
1206 1207 Iter::new(a.iter(), b.iter())
Original file line number Diff line number Diff line change
@@ -876,6 +876,7 @@ pub trait Iterator {
876 876 #[inline]
877 877 #[stable(feature = "rust1", since = "1.0.0")]
878 878 #[rustc_do_not_const_check]
879 +#[cfg_attr(not(test), rustc_diagnostic_item = "iter_filter")]
879 880 fn filter<P>(self, predicate: P) -> Filter<Self, P>
880 881 where
881 882 Self: Sized,
@@ -3412,6 +3413,7 @@ pub trait Iterator {
3412 3413 /// ```
3413 3414 #[stable(feature = "iter_copied", since = "1.36.0")]
3414 3415 #[rustc_do_not_const_check]
3416 +#[cfg_attr(not(test), rustc_diagnostic_item = "iter_copied")]
3415 3417 fn copied<'a, T: 'a>(self) -> Copied<Self>
3416 3418 where
3417 3419 Self: Sized + Iterator<Item = &'a T>,
@@ -3460,6 +3462,7 @@ pub trait Iterator {
3460 3462 /// ```
3461 3463 #[stable(feature = "rust1", since = "1.0.0")]
3462 3464 #[rustc_do_not_const_check]
3465 +#[cfg_attr(not(test), rustc_diagnostic_item = "iter_cloned")]
3463 3466 fn cloned<'a, T: 'a>(self) -> Cloned<Self>
3464 3467 where
3465 3468 Self: Sized + Iterator<Item = &'a T>,
Original file line number Diff line number Diff line change
@@ -1010,6 +1010,7 @@ impl [T] {
1010 1010 /// ```
1011 1011 #[stable(feature = "rust1", since = "1.0.0")]
1012 1012 #[inline]
1013 +#[cfg_attr(not(test), rustc_diagnostic_item = "slice_iter")]
1013 1014 pub fn iter(&self) -> Iter<'_, T> {
1014 1015 Iter::new(self)
1015 1016 }
Original file line number Diff line number Diff line change
@@ -832,6 +832,7 @@ impl str {
832 832 /// ```
833 833 #[stable(feature = "rust1", since = "1.0.0")]
834 834 #[inline]
835 +#[cfg_attr(not(test), rustc_diagnostic_item = "str_chars")]
835 836 pub fn chars(&self) -> Chars<'_> {
836 837 Chars { iter: self.as_bytes().iter() }
837 838 }
Original file line number Diff line number Diff line change
@@ -187,6 +187,7 @@ impl<T, S> HashSet<T, S> {
187 187 #[inline]
188 188 #[rustc_lint_query_instability]
189 189 #[stable(feature = "rust1", since = "1.0.0")]
190 +#[cfg_attr(not(test), rustc_diagnostic_item = "hashset_iter")]
190 191 pub fn iter(&self) -> Iter<'_, T> {
191 192 Iter { base: self.base.iter() }
192 193 }