Open
Description
In both the rust source and the rustfmt source I encountered code of the sort
let first = false;
for x in y {
if first {
first = false;
// do some logic
}
// do some logic
}
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