2016-11-01 23:15:02 -07:00
|
|
|
enum TestEnum {
|
|
|
|
Item(i32),
|
|
|
|
}
|
|
|
|
|
|
|
|
fn test(_: &mut i32) {
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let mut x = TestEnum::Item(10);
|
|
|
|
match x {
|
|
|
|
TestEnum::Item(ref mut x) => {
|
2019-04-22 08:40:08 +01:00
|
|
|
test(&mut x); //~ ERROR cannot borrow `x` as mutable, as it is not declared as mutable
|
2021-07-25 10:23:48 -04:00
|
|
|
//~| HELP try removing `&mut` here
|
2016-11-01 23:15:02 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|