Skip to content
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

Lint let mut x = x; where x is a function argument #1657

Open
oli-obk opened this issue Apr 3, 2017 · 4 comments
Open

Lint let mut x = x; where x is a function argument #1657

oli-obk opened this issue Apr 3, 2017 · 4 comments
Labels
A-lint Area: New lints good-first-issue These issues are a good way to get started with Clippy L-unnecessary Lint: Warn about unnecessary code T-middle Type: Probably requires verifiying types

Comments

@oli-obk
Copy link
Contributor

oli-obk commented Apr 3, 2017

The argument should be made mutable instead of rebinding it to mutable.

@oli-obk oli-obk added L-unnecessary Lint: Warn about unnecessary code good-first-issue These issues are a good way to get started with Clippy A-lint Area: New lints T-middle Type: Probably requires verifiying types labels Apr 3, 2017
@Evrey
Copy link

Evrey commented Apr 5, 2017

Except if we are talking about quickcheck!, which does not support mutable arguments. This macro does allow adding an #[allow(const_argument_mut_rebinding)] or whatever attribute, however. Just wanted to mention this one case.

@clarfonthey
Copy link
Contributor

@Evrey IMHO quickcheck should eventually be able to convert their macro into a proc_macro, removing that need.

@oli-obk
Copy link
Contributor Author

oli-obk commented Apr 6, 2017

We can just bail out inside macros

@cauebs
Copy link
Contributor

cauebs commented Oct 25, 2020

I'll see if I can help with this one. Expect a PR this week, or a somewhat sad comment of me giving up. 🤣

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Area: New lints good-first-issue These issues are a good way to get started with Clippy L-unnecessary Lint: Warn about unnecessary code T-middle Type: Probably requires verifiying types
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants