rust/src/test/compile-fail/assign-imm-local-twice.rs
2012-07-30 18:38:15 -07:00

11 lines
197 B
Rust

fn test() {
let v: int;
v = 1; //~ NOTE prior assignment occurs here
debug!{"v=%d", v};
v = 2; //~ ERROR re-assignment of immutable variable
debug!{"v=%d", v};
}
fn main() {
}