mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-30 16:39:26 +00:00
dadcd94b2a
Prior to this change, it might be that the lint would remove an explicit type that was necessary for the type system to keep track of types. This should be the last change that prevented this lint to be machine applicable.
98 lines
3.1 KiB
Text
98 lines
3.1 KiB
Text
error: you seem to use `.enumerate()` and immediately discard the index
|
|
--> tests/ui/unused_enumerate_index.rs:12:19
|
|
|
|
|
LL | for (_, x) in v.iter().enumerate() {
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: `-D clippy::unused-enumerate-index` implied by `-D warnings`
|
|
= help: to override `-D warnings` add `#[allow(clippy::unused_enumerate_index)]`
|
|
help: remove the `.enumerate()` call
|
|
|
|
|
LL | for x in v.iter() {
|
|
| ~ ~~~~~~~~
|
|
|
|
error: you seem to use `.enumerate()` and immediately discard the index
|
|
--> tests/ui/unused_enumerate_index.rs:59:19
|
|
|
|
|
LL | for (_, x) in dummy.enumerate() {
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: remove the `.enumerate()` call
|
|
|
|
|
LL | for x in dummy {
|
|
| ~ ~~~~~
|
|
|
|
error: you seem to use `.enumerate()` and immediately discard the index
|
|
--> tests/ui/unused_enumerate_index.rs:63:39
|
|
|
|
|
LL | let _ = vec![1, 2, 3].into_iter().enumerate().map(|(_, x)| println!("{x}"));
|
|
| ^^^^^^^^^^^
|
|
|
|
|
help: remove the `.enumerate()` call
|
|
|
|
|
LL - let _ = vec![1, 2, 3].into_iter().enumerate().map(|(_, x)| println!("{x}"));
|
|
LL + let _ = vec![1, 2, 3].into_iter().map(|x| println!("{x}"));
|
|
|
|
|
|
|
error: you seem to use `.enumerate()` and immediately discard the index
|
|
--> tests/ui/unused_enumerate_index.rs:65:39
|
|
|
|
|
LL | let p = vec![1, 2, 3].into_iter().enumerate();
|
|
| ^^^^^^^^^^^
|
|
|
|
|
help: remove the `.enumerate()` call
|
|
|
|
|
LL ~ let p = vec![1, 2, 3].into_iter();
|
|
LL ~ p.map(|x| println!("{x}"));
|
|
|
|
|
|
|
error: you seem to use `.enumerate()` and immediately discard the index
|
|
--> tests/ui/unused_enumerate_index.rs:86:17
|
|
|
|
|
LL | _ = mac2!().enumerate().map(|(_, _v)| {});
|
|
| ^^^^^^^^^^^
|
|
|
|
|
help: remove the `.enumerate()` call
|
|
|
|
|
LL - _ = mac2!().enumerate().map(|(_, _v)| {});
|
|
LL + _ = mac2!().map(|_v| {});
|
|
|
|
|
|
|
error: you seem to use `.enumerate()` and immediately discard the index
|
|
--> tests/ui/unused_enumerate_index.rs:94:39
|
|
|
|
|
LL | let v = [1, 2, 3].iter().copied().enumerate();
|
|
| ^^^^^^^^^^^
|
|
|
|
|
help: remove the `.enumerate()` call
|
|
|
|
|
LL ~ let v = [1, 2, 3].iter().copied();
|
|
LL ~ let x = v.map(|x: i32| x).sum::<i32>();
|
|
|
|
|
|
|
error: you seem to use `.enumerate()` and immediately discard the index
|
|
--> tests/ui/unused_enumerate_index.rs:99:39
|
|
|
|
|
LL | let v = [1, 2, 3].iter().copied().enumerate();
|
|
| ^^^^^^^^^^^
|
|
|
|
|
help: remove the `.enumerate()` call
|
|
|
|
|
LL ~ let v = [1, 2, 3].iter().copied();
|
|
LL ~ let x = v.map(|x: i32| x).sum::<i32>();
|
|
|
|
|
|
|
error: you seem to use `.enumerate()` and immediately discard the index
|
|
--> tests/ui/unused_enumerate_index.rs:103:39
|
|
|
|
|
LL | let v = [1, 2, 3].iter().copied().enumerate();
|
|
| ^^^^^^^^^^^
|
|
|
|
|
help: remove the `.enumerate()` call
|
|
|
|
|
LL ~ let v = [1, 2, 3].iter().copied();
|
|
LL ~ let x = v.map(|x| x).sum::<i32>();
|
|
|
|
|
|
|
error: aborting due to 8 previous errors
|
|
|