rust/tests/ui/auto-instantiate.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
306 B
Rust
Raw Normal View History

//@ run-pass
#![allow(dead_code)]
2015-01-28 13:34:18 +00:00
#[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() {
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);
}