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

12 lines
241 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
take(v); //! ERROR moving out of immutable local variable prohibited due to outstanding loan
}
fn main() {
}