Closed
Description
MIR borrowck considers variables still initialized after their storage ends, so if an immutable variable is defined and used in a loop, this causes an error. e.g.:
fn main() {
loop {
let _x = 0;
}
}
Which causes:
$ rustc x.rs -Z borrowck-mir
error[E0384]: re-assignment of immutable variable `_x` (Mir)
--> x.rs:3:18
|
3 | let _x = 0;
| ^
error: aborting due to previous error