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

12 lines
246 B
Rust
Raw Normal View History

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