rust/src/test/compile-fail/borrowck-loan-blocks-move.rs
2012-10-12 20:43:37 -07:00

12 lines
246 B
Rust

fn take(-_v: ~int) {
}
fn box_imm() {
let v = ~3;
let _w = &v; //~ NOTE loan of immutable local variable granted here
take(move v); //~ ERROR moving out of immutable local variable prohibited due to outstanding loan
}
fn main() {
}