Rollup merge of #124308 - CBSpeir:diagnostic-item-enumerate, r=compiler-errors

Add diagnostic item for `std::iter::Enumerate`

This adds a diagnostic item for `std::iter::Enumerate`.  The change will be used by the clippy `unused_enumerate_index` lint to move away from type paths to using diagnostic items.

see: https://github.com/rust-lang/rust-clippy/issues/5393
This commit is contained in:
León Orell Valerian Liehr 2024-04-24 14:00:58 +02:00 committed by GitHub
commit eaeaeb92a5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 0 deletions

View File

@ -192,6 +192,7 @@
Duration,
Encodable,
Encoder,
Enumerate,
Eq,
Equal,
Err,

View File

@ -15,6 +15,7 @@
#[derive(Clone, Debug)]
#[must_use = "iterators are lazy and do nothing unless consumed"]
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(not(test), rustc_diagnostic_item = "Enumerate")]
pub struct Enumerate<I> {
iter: I,
count: usize,