rust/src/test/ui/did_you_mean/issue-37139.rs

16 lines
239 B
Rust
Raw Normal View History

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
}
}
}