rust/clippy_lints/src/loops
Ethiraric 7cdeac5773 [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.
2024-03-13 20:28:01 +01:00
..
empty_loop.rs Merge commit '97a5daa659' into clippyup 2022-01-13 13:18:19 +01:00
explicit_counter_loop.rs Merge commit 'edb720b199' into clippyup 2023-11-16 19:13:24 +01:00
explicit_into_iter_loop.rs Merge commit '37f4c1725d' into clippyup 2023-07-02 14:59:02 +02:00
explicit_iter_loop.rs Ensure callee_ids are body owners 2024-01-15 12:26:45 -05:00
for_kv_map.rs Merge commit '09ac14c901' into clippyup 2023-11-02 17:35:56 +01:00
infinite_loop.rs Add check for 'in_external_macro' and 'is_from_proc_macro' inside [infinite_loop] lint. 2024-02-21 16:34:07 -06:00
iter_next_loop.rs deprecate clippy::for_loops_over_fallibles 2022-10-09 13:07:21 +00:00
manual_find.rs Merge commit 'edb720b199' into clippyup 2023-11-16 19:13:24 +01:00
manual_flatten.rs Merge commit 'ac4c2094a6' into clippy-subtree-sync 2023-12-28 19:33:07 +01:00
manual_memcpy.rs fix: manual_memcpy wrong suggestion for multi dimensional arrays 2024-02-28 03:48:49 +09:00
manual_while_let_some.rs Merge commit 'd9c24d1b1e' into clippyup 2023-07-17 10:22:32 +02:00
missing_spin_loop.rs Merge commit 'edb720b199' into clippyup 2023-11-16 19:13:24 +01:00
mod.rs Merge commit '60cb29c5e4' into clippyup 2024-02-08 20:24:42 +01:00
mut_range_bound.rs Move some methods from tcx.hir() to tcx 2023-12-12 06:40:29 -08:00
needless_range_loop.rs Pack the u128 in LitKind::Int 2024-01-19 20:10:39 -08:00
never_loop.rs Merge commit '60cb29c5e4' into clippyup 2024-02-08 20:24:42 +01:00
same_item_push.rs hir: Remove hir::Map::{opt_parent_id,parent_id,get_parent,find_parent} 2024-02-10 12:24:46 +03:00
single_element_loop.rs Merge commit 'f0cdee4a3f' into clippy-subtree-sync 2023-12-01 18:21:58 +01:00
unused_enumerate_index.rs [unused_enumerate_index]: trigger on method calls 2024-03-13 20:28:01 +01:00
utils.rs remove redundant imports 2023-12-10 10:56:22 +08:00
while_immutable_condition.rs Merge commit 'edb720b199' into clippyup 2023-11-16 19:13:24 +01:00
while_let_loop.rs separate the receiver from arguments in HIR under /clippy 2022-09-05 22:25:57 +09:00
while_let_on_iterator.rs Merge commit 'ac4c2094a6' into clippy-subtree-sync 2023-12-28 19:33:07 +01:00