rust/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-in-loop.rs

13 lines
268 B
Rust
Raw Normal View History

fn test() {
let v: isize;
//~^ HELP make this binding mutable
//~| SUGGESTION mut v
loop {
v = 1; //~ ERROR cannot assign twice to immutable variable `v`
//~| NOTE cannot assign twice to immutable variable
}
}
fn main() {
}