summary refs log tree commit diff
path: root/src/test/compile-fail/alt-pattern-field-mismatch.rs
blob: 9a54985efc17e932d90150f3657c3b7e64951bf0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
fn main() {
    enum color {
        rgb(uint, uint, uint),
        cmyk(uint, uint, uint, uint),
        no_color,
    }

    fn foo(c: color) {
        match c {
          rgb(_, _) => { }
          //~^ ERROR this pattern has 2 fields, but the corresponding variant has 3 fields
          cmyk(_, _, _, _) => { }
          no_color => { }
        }
    }
}