summaryrefslogtreecommitdiffstats
path: root/tests/ui/generics/generic-tup.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/generics/generic-tup.rs')
-rw-r--r--tests/ui/generics/generic-tup.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/ui/generics/generic-tup.rs b/tests/ui/generics/generic-tup.rs
new file mode 100644
index 000000000..79ebd648c
--- /dev/null
+++ b/tests/ui/generics/generic-tup.rs
@@ -0,0 +1,8 @@
+// run-pass
+fn get_third<T>(t: (T, T, T)) -> T { let (_, _, x) = t; return x; }
+
+pub fn main() {
+ println!("{}", get_third((1, 2, 3)));
+ assert_eq!(get_third((1, 2, 3)), 3);
+ assert_eq!(get_third((5u8, 6u8, 7u8)), 7u8);
+}