Closed
Description
E0384 still uses the old format and can be updated to the new format. Ideally, we would move from span_note to span_label, as well as add a few labels.
Given the example:
fn main() {
let x = 5;
println!("The value of x is: {}", x);
x = 6;
println!("The value of x is: {}", x);
}
This would change the error from this:
error[E0384]: re-assignment of immutable variable `x`
--> jont/varbinder.rs:4:5
|
4 | x = 6;
| ^^^^^
|
note: prior assignment occurs here
--> jont/varbinder.rs:2:9
|
2 | let x = 5;
| ^
to:
error[E0384]: re-assignment of immutable variable `x`
--> jont/varbinder.rs:4:5
2 | let x = 5;
| - first assignment to `x`
3 | println!("The value of x is: {}", x);
4 | x = 6;
| ^^^^^ re-assignment of immutable `x`