Lint variable only ever assigned a single value #4016
Labels
A-lint
Area: New lints
L-correctness
Lint: Belongs in the correctness lint group
T-MIR
Type: This lint will require working with the MIR
In both the rust source and the rustfmt source I encountered code of the sort
If a variable never gets a mutable reference taken to and all assignments assign the same value, we should have a correctness lint tell the user they are doing something that makes no sense in any program.
This is probably easiest implemented as an MIR lint
The text was updated successfully, but these errors were encountered: