mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 15:01:51 +00:00
17 lines
385 B
Rust
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 => { }
|
|
}
|
|
}
|
|
}
|