summary refs log tree commit diff
path: root/src/test/compile-fail/alt-pattern-field-mismatch-2.rs
blob: b8d4dab9539f7056e3690ec5dd8585e047bc47d3 (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) {
        alt c {
          rgb(_, _, _) { }
          cmyk(_, _, _, _) { }
          no_color(_) { }
          //~^ ERROR this pattern has 1 field, but the corresponding variant has no fields
        }
    }
}