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