diff options
| author | bors <bors@rust-lang.org> | 2024-03-14 22:26:06 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-03-14 22:26:06 +0000 |
| commit | 5a11fefc259e56ef305a9d53caf0ac7a0835b609 (patch) | |
| tree | 41de9c95fa3a3438227811b136fa5e572d2a0d21 /tests/codegen/patchable-function-entry/patchable-function-entry-both-flags.rs | |
| parent | b667d0234015e079e669f01dbe6f27d47149dbba (diff) | |
| parent | dadcd94b2af45be66281bd8400ec72485e2f84fc (diff) | |
| download | rust-5a11fefc259e56ef305a9d53caf0ac7a0835b609.tar.gz rust-5a11fefc259e56ef305a9d53caf0ac7a0835b609.zip | |
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)`
Diffstat (limited to 'tests/codegen/patchable-function-entry/patchable-function-entry-both-flags.rs')
0 files changed, 0 insertions, 0 deletions
