rust/src/test/compile-fail/liveness-assign-imm-local-in-loop.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

12 lines
223 B
Rust

fn test() {
let v: int;
loop {
v = 1; //! ERROR re-assignment of immutable variable
//!^ NOTE prior assignment occurs here
copy v; // just to prevent liveness warnings
}
}
fn main() {
}