diff options
Diffstat (limited to 'tests/ui/structs-enums/tuple-struct-matching.rs')
-rw-r--r-- | tests/ui/structs-enums/tuple-struct-matching.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/ui/structs-enums/tuple-struct-matching.rs b/tests/ui/structs-enums/tuple-struct-matching.rs new file mode 100644 index 000000000..432be1d1f --- /dev/null +++ b/tests/ui/structs-enums/tuple-struct-matching.rs @@ -0,0 +1,13 @@ +// run-pass +struct Foo(isize, isize); + +pub fn main() { + let x = Foo(1, 2); + match x { + Foo(a, b) => { + assert_eq!(a, 1); + assert_eq!(b, 2); + println!("{} {}", a, b); + } + } +} |