mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-29 18:23:49 +00:00
10 lines
250 B
Rust
10 lines
250 B
Rust
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
|
|
//~| HELP try removing `&mut` here
|
|
None => {},
|
|
}
|
|
}
|