]> git.lizzy.rs Git - rust.git/blob - tests/ui/auto-instantiate.rs
Rollup merge of #107740 - oli-obk:lock_tcx, r=petrochenkov
[rust.git] / tests / ui / auto-instantiate.rs
1 // run-pass
2
3 #![allow(dead_code)]
4 #[derive(Debug)]
5 struct Pair<T, U> { a: T, b: U }
6 struct Triple { x: isize, y: isize, z: isize }
7
8 fn f<T,U>(x: T, y: U) -> Pair<T, U> { return Pair {a: x, b: y}; }
9
10 pub fn main() {
11     println!("{}", f(Triple {x: 3, y: 4, z: 5}, 4).a.x);
12     println!("{}", f(5, 6).a);
13 }