rust/src/test/compile-fail/borrowck-move-moved-value-into-closure.rs
2013-11-26 08:25:27 -08:00

11 lines
174 B
Rust

fn call_f(f: proc() -> int) -> int {
f()
}
fn main() {
let t = ~3;
call_f(proc() { *t + 1 });
call_f(proc() { *t + 1 }); //~ ERROR capture of moved value
}