2012-06-21 15:02:43 -07:00
|
|
|
fn main() {
|
2018-12-16 22:21:47 -05:00
|
|
|
enum Color {
|
|
|
|
Rgb(usize, usize, usize),
|
|
|
|
Cmyk(usize, usize, usize, usize),
|
|
|
|
NoColor,
|
2012-06-21 15:02:43 -07:00
|
|
|
}
|
|
|
|
|
2018-12-16 22:21:47 -05:00
|
|
|
fn foo(c: Color) {
|
2012-08-06 12:34:08 -07:00
|
|
|
match c {
|
2018-12-16 22:21:47 -05:00
|
|
|
Color::Rgb(_, _) => { }
|
2019-10-14 17:20:50 -07:00
|
|
|
//~^ ERROR this pattern has 2 fields, but the corresponding tuple variant has 3
|
2018-12-16 22:21:47 -05:00
|
|
|
Color::Cmyk(_, _, _, _) => { }
|
|
|
|
Color::NoColor => { }
|
2012-06-21 15:02:43 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|