summaryrefslogtreecommitdiffstats
path: root/tests/ui/match/match-pattern-field-mismatch.rs
blob: a4fa97fef38e9eeb89f9374273a2551d9031d87e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
fn main() {
    enum Color {
        Rgb(usize, usize, usize),
        Cmyk(usize, usize, usize, usize),
        NoColor,
    }

    fn foo(c: Color) {
        match c {
          Color::Rgb(_, _) => { }
          //~^ ERROR this pattern has 2 fields, but the corresponding tuple variant has 3
          Color::Cmyk(_, _, _, _) => { }
          Color::NoColor => { }
        }
    }
}