rust/src/test/compile-fail/borrowck-loan-blocks-move.rs

12 lines
240 B
Rust
Raw Normal View History

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