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 11:39:45 +00:00
pub fn main() {
2015-01-25 21:05:03 +00:00
println!("{}", get_third((1, 2, 3)));
assert_eq!(get_third((1, 2, 3)), 3);
assert_eq!(get_third((5u8, 6u8, 7u8)), 7u8);
}