Skip to content

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

Closed
@MaikKlein

Description

@MaikKlein

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions