rust/tests
bors 5a11fefc25 Auto merge of #12432 - Ethiraric:fix-12411, r=y21
[`unused_enumerate_index`]: trigger on method calls

The lint used to check for patterns looking like:
```rs
for (_, x) in some_iter.enumerate() {
    // Index is ignored
}
```

This commit further checks for chained method calls constructs where we
can detect that the index is unused. Currently, this checks only for the
following patterns:
```rs
some_iter.enumerate().map_function(|(_, x)| ..)
let x = some_iter.enumerate();
x.map_function(|(_, x)| ..)
```
where `map_function` is one of `all`, `any`, `filter_map`, `find_map`,
`flat_map`, `for_each` or `map`.

Fixes #12411.

*Please write a short comment explaining your change (or "none" for internal only changes)*

changelog: [`unused_enumerate_index`]: add detection for method chains such as `iter.enumerate().map(|(_, x)| x)`
2024-03-14 22:26:06 +00:00
..
test_utils
ui Auto merge of #12432 - Ethiraric:fix-12411, r=y21 2024-03-14 22:26:06 +00:00
ui-cargo Merge commit '10136170fe9ed01e46aeb4f4479175b79eb0e3c7' into clippy-subtree-update 2024-02-27 15:50:17 +01:00
ui-internal mention span_lint_hir in span_lint and add a reason to disallowed_methods 2024-03-09 19:40:39 +01:00
ui-toml Merge remote-tracking branch 'upstream/master' into rustup 2024-03-07 17:14:36 +01:00
workspace_test
check-fmt.rs
clippy.toml
compile-test.rs Show duplicate diagnostics in UI tests by default 2024-02-28 13:24:14 +00:00
dogfood.rs
headers.rs
integration.rs
lint_message_convention.rs
missing-test-files.rs Fix lint errors 2024-03-01 16:36:05 +01:00
versioncheck.rs
workspace.rs