Skip to content

Commit

Permalink
Rollup merge of rust-lang#124308 - CBSpeir:diagnostic-item-enumerate,…
Browse files Browse the repository at this point in the history
… 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: rust-lang/rust-clippy#5393
  • Loading branch information
fmease authored Apr 24, 2024
2 parents f141c8f + bcc4469 commit a3e8852
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 a3e8852

Please sign in to comment.