diff options
| author | Timo <30553356+y21@users.noreply.github.com> | 2025-08-28 13:23:20 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-28 13:23:20 +0000 |
| commit | 44abf28bb38fe7af8e8e131d6641689e075c44d2 (patch) | |
| tree | 423df6a474d02d510e389a816ee2cd76dfc9089a /compiler/rustc_llvm/llvm-wrapper/Linker.cpp | |
| parent | c0f29d71c0a8734e703c57a2a9453f772455cf71 (diff) | |
| parent | 61ce0c5dc25aeb34cae36d2ea4587d6dbbfb5586 (diff) | |
| download | rust-44abf28bb38fe7af8e8e131d6641689e075c44d2.tar.gz rust-44abf28bb38fe7af8e8e131d6641689e075c44d2.zip | |
`map_identity`: suggest making the variable mutable when necessary (#15268)
While working on rust-lang/rust-clippy#15229, I noticed a test case in `map_identity` which avoids linting in the case where removing the `.map()` would require the iterator variable to be made mutable. But then I saw rust-lang/rust-clippy#14140, and thought I'd try to adapt its approach, by suggesting both removing the `.map()` _and_ making the variable mutable. This is WIP only because I'm not sure about the very last `diag.span_note` -- I think having a method chained immediately after the `.map()` is the only case which requires adding `mut`, so it should be safe to say that `method_requiring_mut` is always `Some`. I'd like to do a lintcheck run to see if that's actually true. @samueltardieu do you think this is a good approach? Maybe there are more lints where we could lint + suggest making the variable mut, instead of not linting? changelog:`map_identity`: suggest making the variable mutable when necessary
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/Linker.cpp')
0 files changed, 0 insertions, 0 deletions
