rust/src/test/compile-fail/borrowck-issue-2657-1.rs
2012-08-26 15:56:16 -07:00

10 lines
234 B
Rust

fn main() {
let x = Some(~1);
match x { //~ NOTE loan of immutable local variable granted here
Some(ref _y) => {
let _a <- x; //~ ERROR moving out of immutable local variable prohibited due to outstanding loan
}
_ => {}
}
}