diff options
Diffstat (limited to 'tests/ui/binding/match-enum-struct-1.rs')
-rw-r--r-- | tests/ui/binding/match-enum-struct-1.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/ui/binding/match-enum-struct-1.rs b/tests/ui/binding/match-enum-struct-1.rs new file mode 100644 index 000000000..f035432ec --- /dev/null +++ b/tests/ui/binding/match-enum-struct-1.rs @@ -0,0 +1,19 @@ +// run-pass +#![allow(dead_code)] + +enum E { + Foo{f : isize}, + Bar +} + +pub fn main() { + let e = E::Foo{f: 1}; + match e { + E::Foo{..} => (), + _ => panic!(), + } + match e { + E::Foo{f: _f} => (), + _ => panic!(), + } +} |