summaryrefslogtreecommitdiffstats
path: root/tests/ui/generics/generic-tup.rs
blob: 79ebd648cd45a1ca6cbb0dcccd5e103750112248 (plain)
1
2
3
4
5
6
7
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);
}