rust/tests/ui/generics/generic-tup.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

9 lines
231 B
Rust
Raw Normal View History

// run-pass
fn get_third<T>(t: (T, T, T)) -> T { let (_, _, x) = t; return x; }
2011-08-15 06:39:45 -05:00
pub fn main() {
2015-01-25 15:05:03 -06:00
println!("{}", get_third((1, 2, 3)));
assert_eq!(get_third((1, 2, 3)), 3);
assert_eq!(get_third((5u8, 6u8, 7u8)), 7u8);
}