diff options
| author | León Orell Valerian Liehr <me@fmease.dev> | 2024-04-24 14:00:58 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-24 14:00:58 +0200 |
| commit | eaeaeb92a5756a596d28d8952b6a85c67ee72d5f (patch) | |
| tree | 43013857f8d4132dcd2f6ea721b2679cf0b315cc | |
| parent | 388dc0d0b7e0d7aeacccbe18d2120053dee5ee7a (diff) | |
| parent | bcc4469c2b4d75bd52f23d404e9c4b3561372b2a (diff) | |
| download | rust-eaeaeb92a5756a596d28d8952b6a85c67ee72d5f.tar.gz rust-eaeaeb92a5756a596d28d8952b6a85c67ee72d5f.zip | |
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
| -rw-r--r-- | compiler/rustc_span/src/symbol.rs | 1 | ||||
| -rw-r--r-- | library/core/src/iter/adapters/enumerate.rs | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs index 8abf42e2c13..99591b5e144 100644 --- a/compiler/rustc_span/src/symbol.rs +++ b/compiler/rustc_span/src/symbol.rs @@ -192,6 +192,7 @@ symbols! { Duration, Encodable, Encoder, + Enumerate, Eq, Equal, Err, diff --git a/library/core/src/iter/adapters/enumerate.rs b/library/core/src/iter/adapters/enumerate.rs index ef46040f0a7..7adbabf69e4 100644 --- a/library/core/src/iter/adapters/enumerate.rs +++ b/library/core/src/iter/adapters/enumerate.rs @@ -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, |
