diff options
Diffstat (limited to 'tests/ui/rfcs/rfc-2005-default-binding-mode/tuple.rs')
-rw-r--r-- | tests/ui/rfcs/rfc-2005-default-binding-mode/tuple.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/ui/rfcs/rfc-2005-default-binding-mode/tuple.rs b/tests/ui/rfcs/rfc-2005-default-binding-mode/tuple.rs new file mode 100644 index 000000000..4c22aa2d7 --- /dev/null +++ b/tests/ui/rfcs/rfc-2005-default-binding-mode/tuple.rs @@ -0,0 +1,12 @@ +// run-pass +pub fn main() { + let foo = (Some(1), (), (), vec![2, 3]); + + match &foo { + (Some(n), .., v) => { + assert_eq!((*v).len(), 2); + assert_eq!(*n, 1); + } + (None, (), (), ..) => panic!(), + } +} |