mirror of
https://github.com/rust-lang/rust
synced 2024-11-05 20:45:15 +00:00
13 lines
306 B
Rust
13 lines
306 B
Rust
//@ run-pass
|
|
|
|
#![allow(dead_code)]
|
|
#[derive(Debug)]
|
|
struct Pair<T, U> { a: T, b: U }
|
|
struct Triple { x: isize, y: isize, z: isize }
|
|
|
|
fn f<T,U>(x: T, y: U) -> Pair<T, U> { return Pair {a: x, b: y}; }
|
|
|
|
pub fn main() {
|
|
println!("{}", f(Triple {x: 3, y: 4, z: 5}, 4).a.x);
|
|
println!("{}", f(5, 6).a);
|
|
}
|