/src/test/run-pass/auto-instantiate.rs

http://github.com/jruderman/rust · Rust · 10 lines · 5 code · 4 blank · 1 comment · 0 complexity · 8abee07560586662e776347f280fed8c MD5 · raw file

  1. // -*- rust -*-
  2. fn f<T: copy, U: copy>(x: T, y: U) -> {a: T, b: U} { return {a: x, b: y}; }
  3. fn main() {
  4. log(debug, f({x: 3, y: 4, z: 5}, 4).a.x);
  5. log(debug, f(5, 6).a);
  6. }