mirror of
https://github.com/rust-lang/rust
synced 2024-11-05 20:45:15 +00:00
16 lines
325 B
Rust
16 lines
325 B
Rust
enum TestEnum {
|
|
Item(i32),
|
|
}
|
|
|
|
fn test(_: &mut i32) {
|
|
}
|
|
|
|
fn main() {
|
|
let mut x = TestEnum::Item(10);
|
|
match x {
|
|
TestEnum::Item(ref mut x) => {
|
|
test(&mut x); //~ ERROR cannot borrow `x` as mutable, as it is not declared as mutable
|
|
//~| HELP try removing `&mut` here
|
|
}
|
|
}
|
|
}
|