rust/src/test/compile-fail/assign-imm-local-twice.rs
2012-08-23 11:14:14 -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() {
}