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

13 lines
289 B
Rust
Raw Normal View History

fn test() {
let v: isize;
//~^ HELP make this binding mutable
//~| SUGGESTION mut v
v = 2; //~ NOTE first assignment
v += 1; //~ ERROR cannot assign twice to immutable variable `v`
//~| NOTE cannot assign twice to immutable
2013-07-02 19:47:32 +00:00
v.clone();
}
fn main() {
}