Open
Description
Summary
cargo clippy --fix
can autofix more problems
Reproducer
I tried this code:
fn foo(_x: &i32) {}
fn main() {
let mut x = 5i32;
foo(&mut x); // this mut is redundant
}
I expected to see this happen:
cargo clippy --fix
removes this redundant mut
.
Instead, this happened:
cargo clippy --fix
warns about this redundant mut
I don't see any use cases were this mut
can make side effects and it is not safe to remove it automatically. Is it just not implemented yet or there are some cases where auto removing this mut
can bring side effects?
Version
rustc 1.85.0-nightly (21fe748be 2024-12-11)
binary: rustc
commit-hash: 21fe748be15271ea5804e0507cd699b675efe038
commit-date: 2024-12-11
host: aarch64-apple-darwin
release: 1.85.0-nightly
LLVM version: 19.1.5
Additional Labels
No response
Summary Notes
Generated by triagebot, see help for how to add more