2019-07-26 21:54:25 +00:00
|
|
|
// run-pass
|
|
|
|
|
2018-09-14 10:20:28 +00:00
|
|
|
#![allow(dead_code)]
|
2015-01-28 13:34:18 +00:00
|
|
|
#[derive(Debug)]
|
2013-01-26 06:46:32 +00:00
|
|
|
struct Pair<T, U> { a: T, b: U }
|
2015-03-26 00:06:52 +00:00
|
|
|
struct Triple { x: isize, y: isize, z: isize }
|
2013-01-26 06:46:32 +00:00
|
|
|
|
2013-07-10 21:43:25 +00:00
|
|
|
fn f<T,U>(x: T, y: U) -> Pair<T, U> { return Pair {a: x, b: y}; }
|
2011-06-15 18:19:50 +00:00
|
|
|
|
2013-02-02 03:43:17 +00:00
|
|
|
pub fn main() {
|
2015-01-25 21:05:03 +00:00
|
|
|
println!("{}", f(Triple {x: 3, y: 4, z: 5}, 4).a.x);
|
|
|
|
println!("{}", f(5, 6).a);
|
2011-12-22 22:42:52 +00:00
|
|
|
}
|