rust/src/test/ui/match/match-pattern-field-mismatch-2.rs

17 lines
389 B
Rust
Raw Normal View History

fn main() {
enum Color {
Rgb(usize, usize, usize),
Cmyk(usize, usize, usize, usize),
NoColor,
}
fn foo(c: Color) {
2012-08-06 19:34:08 +00:00
match c {
Color::Rgb(_, _, _) => { }
Color::Cmyk(_, _, _, _) => { }
Color::NoColor(_) => { }
//~^ ERROR expected tuple struct/variant, found unit variant `Color::NoColor`
}
}
}