summaryrefslogtreecommitdiffstats
path: root/src/test/ui/mismatched_types/suggest-adding-or-removing-ref-for-binding-pattern.fixed
blob: 56f93cfbfdcbec4789a0b8317009370fcd49ce13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// run-rustfix
#![allow(dead_code, unused_variables)]

fn main() {
    enum Blah {
        A(isize, isize, usize),
        B(isize, usize),
    }

    match Blah::A(1, 1, 2) {
        Blah::A(_, x, ref y) | Blah::B(x, ref y) => {}
        //~^ ERROR mismatched types
        //~| ERROR variable `y` is bound inconsistently across alternatives separated by `|`
    }

    match Blah::A(1, 1, 2) {
        Blah::A(_, x, y) | Blah::B(x, y) => {}
        //~^ ERROR mismatched types
        //~| variable `y` is bound inconsistently across alternatives separated by `|`
    }
}