rust/tests/ui/did_you_mean/issue-37139.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
325 B
Rust
Raw Normal View History

2016-11-02 06:15:02 +00:00
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
2016-11-02 06:15:02 +00:00
}
}
}