Skip to content

Commit

Permalink
Rollup merge of #124308 - CBSpeir:diagnostic-item-enumerate, r=compil…
Browse files Browse the repository at this point in the history
…er-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: rust-lang/rust-clippy#5393
  • Loading branch information
fmease authored Apr 24, 2024
2 parents 388dc0d + bcc4469 commit eaeaeb9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions compiler/rustc_span/src/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ symbols! {
Duration,
Encodable,
Encoder,
Enumerate,
Eq,
Equal,
Err,
Expand Down
1 change: 1 addition & 0 deletions library/core/src/iter/adapters/enumerate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use crate::ops::Try;
#[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,
Expand Down

0 comments on commit eaeaeb9

Please sign in to comment.