diff options
| author | Ethiraric <ethiraric@gmail.com> | 2024-03-07 18:50:47 +0100 |
|---|---|---|
| committer | Ethiraric <ethiraric@gmail.com> | 2024-03-13 20:28:01 +0100 |
| commit | 7cdeac5773ac7664731d8cb850334559b4b9dab8 (patch) | |
| tree | a889d5353b2621899aa0b9acf8c6bcd82cccba5c /tests/codegen/patchable-function-entry/patchable-function-entry-both-flags.rs | |
| parent | 43f4ec3b133262e6d23a0f5401aadaf60f5bc07a (diff) | |
| download | rust-7cdeac5773ac7664731d8cb850334559b4b9dab8.tar.gz rust-7cdeac5773ac7664731d8cb850334559b4b9dab8.zip | |
[`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.
Diffstat (limited to 'tests/codegen/patchable-function-entry/patchable-function-entry-both-flags.rs')
0 files changed, 0 insertions, 0 deletions
