Rollup merge of #124542 - CBSpeir:diagnostic-item-enumerate-method, r=scottmcm

Add diagnostic item for `std::iter::Iterator::enumerate`

Adds a diagnostic item for the `std::iter:Iterator::enumerate` trait method. This change, along with PR https://github.com/rust-lang/rust/pull/124308, will be used by the clippy `unused_enumerate_index` lint to move away from paths to using diagnostic items.

see: https://github.com/rust-lang/rust-clippy/issues/5393
This commit is contained in:
Matthias Krüger 2024-05-01 20:05:26 +02:00 committed by GitHub
commit 38cbad9d26
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 0 deletions

View File

@ -754,6 +754,7 @@
enable,
encode,
end,
enumerate_method,
env,
env_CFG_RELEASE: env!("CFG_RELEASE"),
eprint_macro,

View File

@ -974,6 +974,7 @@ fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_do_not_const_check]
#[cfg_attr(not(test), rustc_diagnostic_item = "enumerate_method")]
fn enumerate(self) -> Enumerate<Self>
where
Self: Sized,