2012-12-10 17:32:48 -08:00
|
|
|
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
|
|
|
|
// file at the top-level directory of this distribution and at
|
|
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
// except according to those terms.
|
|
|
|
|
2014-05-22 11:28:01 -07:00
|
|
|
extern crate debug;
|
2013-01-25 22:46:32 -08:00
|
|
|
|
|
|
|
struct Pair<T, U> { a: T, b: U }
|
|
|
|
struct Triple { x: int, y: int, z: int }
|
|
|
|
|
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() {
|
2014-06-27 12:30:25 -07:00
|
|
|
println!("{:?}", f(Triple {x: 3, y: 4, z: 5}, 4i).a.x);
|
2014-04-21 17:58:52 -04:00
|
|
|
println!("{:?}", f(5i, 6i).a);
|
2011-12-22 14:42:52 -08:00
|
|
|
}
|