diff options
Diffstat (limited to 'tests/ui/binding/pat-tuple-2.rs')
-rw-r--r-- | tests/ui/binding/pat-tuple-2.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/ui/binding/pat-tuple-2.rs b/tests/ui/binding/pat-tuple-2.rs new file mode 100644 index 000000000..810fd2641 --- /dev/null +++ b/tests/ui/binding/pat-tuple-2.rs @@ -0,0 +1,23 @@ +// run-pass +fn tuple() { + let x = (1,); + match x { + (2, ..) => panic!(), + (..) => () + } +} + +fn tuple_struct() { + struct S(u8); + + let x = S(1); + match x { + S(2, ..) => panic!(), + S(..) => () + } +} + +fn main() { + tuple(); + tuple_struct(); +} |