-
Notifications
You must be signed in to change notification settings - Fork 1.6k
cargo clippy --fix
don't remove redundant mut
#14617
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This is not a bug, but an enhancement request. You are right, this could be suggested by Clippy, and auto-applied in most (all?) cases. @rustbot label -C-bug +C-enhancement +good-first-issue |
This comment has been minimized.
This comment has been minimized.
Thanks @samueltardieu for your answers! I'd like to try take this one, and since I'm newcomer it may take a time for me, so will appreciate if more experienced contributors won't take this for a while |
@rustbot claim |
This will let people [add summary notes](https://forge.rust-lang.org/triagebot/note.html) to an issue, for example to add that an issue is best kept for first-timers. changelog: none I wanted to use it in #14617 (comment).
Note for our regular contributors: please keep issues labelled "good-first-issue" for people wanting to dip their toes into Clippy's code with something easy. Feel free to claim them if they haven't found someone in months though. (I know this is claimed already, I'm testing the note feature) @rustbot note "Best claimed by first-timers" |
Summary
cargo clippy --fix
can autofix more problemsReproducer
I tried this code:
I expected to see this happen:
cargo clippy --fix
removes this redundantmut
.Instead, this happened:
cargo clippy --fix
warns about this redundantmut
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 thismut
can bring side effects?Version
Additional Labels
No response
Summary Notes
Generated by triagebot, see help for how to add more
The text was updated successfully, but these errors were encountered: