rust/clippy_utils/src
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
..
ast_utils Merge commit '928e72dd10' into clippyup 2021-02-25 11:25:22 +01:00
mir Convert TypeVisitor and DefIdVisitor to use VisitorResult 2024-03-05 13:28:15 -05:00
ty/type_certainty hir: Remove hir::Map::{opt_parent_id,parent_id,get_parent,find_parent} 2024-02-10 12:24:46 +03:00
ast_utils.rs Merge commit '10136170fe' into clippy-subtree-update 2024-02-27 15:50:17 +01:00
attrs.rs Merge commit '66c29b973b' into clippy-subtree-update 2024-01-25 19:17:36 +01:00
check_proc_macro.rs Give VariantData::Struct named fields, to clairfy recovered. 2023-12-20 00:07:34 +00:00
comparisons.rs Merge commit 'd9c24d1b1e' into clippyup 2023-07-17 10:22:32 +02:00
consts.rs Auto merge of #12310 - samueltardieu:issue-12307, r=xFrednet 2024-03-09 09:56:37 +00:00
diagnostics.rs apply review suggestions 2024-03-09 23:28:48 +01:00
eager_or_lazy.rs Merge commit '26ac6aab02' 2024-01-11 17:27:03 +01:00
higher.rs Merge commit 'ac4c2094a6' into clippy-subtree-sync 2023-12-28 19:33:07 +01:00
hir_utils.rs Merge commit '10136170fe' into clippy-subtree-update 2024-02-27 15:50:17 +01:00
lib.rs [unconditional_recursion]: catch From -> Into -> From 2024-03-13 17:22:54 +01:00
macros.rs Merge commit '26ac6aab02' 2024-01-11 17:27:03 +01:00
numeric_literal.rs Merge commit '37f4c1725d' into clippyup 2023-07-02 14:59:02 +02:00
paths.rs [unused_enumerate_index]: trigger on method calls 2024-03-13 20:28:01 +01:00
ptr.rs Merge commit 'ac0e10aa68' into clippyup 2022-10-06 09:44:38 +02:00
qualify_min_const_fn.rs Add is_intrinsic helper 2024-03-04 16:13:50 +00:00
source.rs Merge commit '09ac14c901' into clippyup 2023-11-02 17:35:56 +01:00
str_utils.rs Merge commit '09ac14c901' into clippyup 2023-11-02 17:35:56 +01:00
sugg.rs Merge remote-tracking branch 'upstream/master' into rustup 2024-03-07 17:14:36 +01:00
sym_helper.rs Merge commit '928e72dd10' into clippyup 2021-02-25 11:25:22 +01:00
ty.rs Convert TypeVisitor and DefIdVisitor to use VisitorResult 2024-03-05 13:28:15 -05:00
usage.rs Merge commit '98363cbf6a' into clippyup 2023-09-12 18:44:06 +02:00
visitors.rs Merge commit 'ac4c2094a6' into clippy-subtree-sync 2023-12-28 19:33:07 +01:00