rust/tests/ui/borrowck/borrowck-ref-mut-of-imm.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

11 lines
193 B
Rust
Raw Normal View History

fn destructure(x: Option<isize>) -> isize {
match x {
2012-08-20 19:23:37 +00:00
None => 0,
2013-03-15 19:24:24 +00:00
Some(ref mut v) => *v //~ ERROR cannot borrow
}
}
fn main() {
assert_eq!(destructure(Some(22)), 22);
}