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

12 lines
246 B
Rust
Raw Normal View History

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