2016-11-02 01:15:02 -05: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 02:40:08 -05:00
|
|
|
test(&mut x); //~ ERROR cannot borrow `x` as mutable, as it is not declared as mutable
|
2021-07-25 09:23:48 -05:00
|
|
|
//~| HELP try removing `&mut` here
|
2016-11-02 01:15:02 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|