summaryrefslogtreecommitdiffstats
path: root/src/test/ui/match/match-pattern-field-mismatch-2.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/match/match-pattern-field-mismatch-2.rs')
-rw-r--r--src/test/ui/match/match-pattern-field-mismatch-2.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/test/ui/match/match-pattern-field-mismatch-2.rs b/src/test/ui/match/match-pattern-field-mismatch-2.rs
new file mode 100644
index 000000000..fa03cdac2
--- /dev/null
+++ b/src/test/ui/match/match-pattern-field-mismatch-2.rs
@@ -0,0 +1,16 @@
+fn main() {
+ enum Color {
+ Rgb(usize, usize, usize),
+ Cmyk(usize, usize, usize, usize),
+ NoColor,
+ }
+
+ fn foo(c: Color) {
+ match c {
+ Color::Rgb(_, _, _) => { }
+ Color::Cmyk(_, _, _, _) => { }
+ Color::NoColor(_) => { }
+ //~^ ERROR expected tuple struct or tuple variant, found unit variant `Color::NoColor`
+ }
+ }
+}