summaryrefslogtreecommitdiffstats
path: root/src/test/ui/did_you_mean/issue-37139.rs
blob: 6a19d85ff79f9a1af4c7d1335a5eb8b3348e62a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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
        }
    }
}