rust/tests/ui/unused_enumerate_index.stderr

63 lines
2.0 KiB
Plaintext
Raw Normal View History

2023-02-25 19:18:08 -06:00
error: you seem to use `.enumerate()` and immediately discard the index
--> tests/ui/unused_enumerate_index.rs:12:19
2023-02-25 19:18:08 -06:00
|
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: aborting due to 5 previous errors
2023-02-25 19:18:08 -06:00