rust/tests/ui/borrowck/issue-33819.rs

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

10 lines
250 B
Rust
Raw Normal View History

2016-05-23 13:48:11 -05:00
fn main() {
let mut op = Some(2);
match op {
Some(ref v) => { let a = &mut v; },
//~^ ERROR cannot borrow `v` as mutable, as it is not declared as mutable
2021-07-25 09:56:13 -05:00
//~| HELP try removing `&mut` here
2016-05-23 13:48:11 -05:00
None => {},
}
}