Closed
Description
From @jruderman 's comment on #1832:
IMO, the "unused" warning should be per-assignment, not per-variable.
fn main() {
let mut x = 10;
x = 20;
log(error, x);
}
should warn because the first assignment to x is unused.
fn main() {
let mut x = 10;
log(error, x);
x = 20;
}
should warn because the second assignment to x is unused. Finally, the original example,
fn main() {
let mut x = 10, y = 20;
x <-> y;
log(error, y);
}
should warn because the second assignment to x is unused.