rust/src/test/compile-fail/assign-imm-local-twice.rs
Niko Matsakis 0d3811e275 improve liveness so it reports unused vars / dead assignments
doesn't warn about pattern bindings yet though
2012-05-24 09:52:16 -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() {
}