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 18:48:11 +00: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 14:56:13 +00:00
//~| HELP try removing `&mut` here
2016-05-23 18:48:11 +00:00
None => {},
}
}