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