mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 00:34:06 +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 => { }
|
|
}
|
|
}
|
|
}
|