rust/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-with-init.rs

13 lines
330 B
Rust
Raw Normal View History

fn test() {
let v: isize = 1; //~ NOTE first assignment
//~| HELP make this binding mutable
//~| SUGGESTION mut v
2013-07-02 19:47:32 +00:00
v.clone();
v = 2; //~ 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() {
}