rust/tests/ui/match/match-pattern-field-mismatch.rs
2023-01-11 09:32:08 +00:00

17 lines
385 B
Rust

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 => { }
}
}
}