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

cargo fix renames unused local variables from foo to _foo #6023

Closed
MaikKlein opened this issue Sep 13, 2018 · 2 comments
Closed

cargo fix renames unused local variables from foo to _foo #6023

MaikKlein opened this issue Sep 13, 2018 · 2 comments

Comments

@MaikKlein
Copy link

For example:

let device = &self.ctx.device;
let _device = &self.ctx.device;

I don't like that refactor because I might end up with local variables that do nothing. I think cargo fix should just ignore unused local variables all together. If cargo fix just renames local variables to hide the warnings from the compiler, then the compiler lint is a bit pointless.

Renaming unused function parameters seems fine.

@alexcrichton
Copy link
Member

Thanks for the report! I think this may be best reported at rust-lang/rust though where the fix would live. Mind reopening the issue over there?

@MaikKlein
Copy link
Author

@alexcrichton Sure no problem, I created a new issue rust-lang/rust#54196

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants