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) => {
|
2017-11-20 06:13:27 -06:00
|
|
|
test(&mut x); //~ ERROR cannot borrow immutable
|
2016-11-02 01:15:02 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|