Skip to content

Commit 38cbad9

Browse files
authored
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 #124308, will be used by the clippy `unused_enumerate_index` lint to move away from paths to using diagnostic items. see: rust-lang/rust-clippy#5393
2 parents 9ba3d31 + c8079e9 commit 38cbad9

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

compiler/rustc_span/src/symbol.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,7 @@ symbols! {
754754
enable,
755755
encode,
756756
end,
757+
enumerate_method,
757758
env,
758759
env_CFG_RELEASE: env!("CFG_RELEASE"),
759760
eprint_macro,

library/core/src/iter/traits/iterator.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -974,6 +974,7 @@ pub trait Iterator {
974974
#[inline]
975975
#[stable(feature = "rust1", since = "1.0.0")]
976976
#[rustc_do_not_const_check]
977+
#[cfg_attr(not(test), rustc_diagnostic_item = "enumerate_method")]
977978
fn enumerate(self) -> Enumerate<Self>
978979
where
979980
Self: Sized,

0 commit comments

Comments
 (0)