rust/src/test/compile-fail/borrowck-issue-2657-1.rs

10 lines
238 B
Rust
Raw Normal View History

fn main() {
2012-08-20 12:23:37 -07:00
let x = Some(~1);
2012-08-06 12:34:08 -07:00
match x { //~ NOTE loan of immutable local variable granted here
2012-08-20 12:23:37 -07:00
Some(ref _y) => {
let _a = move x; //~ ERROR moving out of immutable local variable prohibited due to outstanding loan
}
2012-08-03 19:59:04 -07:00
_ => {}
}
}