rust/src/test/run-pass/generic-bind.rs

18 lines
348 B
Rust
Raw Normal View History

fn id<T: copy>(t: T) -> T { ret t; }
fn main() {
2011-07-27 07:19:39 -05:00
let t = {_0: 1, _1: 2, _2: 3, _3: 4, _4: 5, _5: 6, _6: 7};
assert (t._5 == 6);
2011-07-27 07:19:39 -05:00
let f1 =
id::<{_0: int,
_1: int,
_2: int,
_3: int,
_4: int,
_5: int,
_6: int}>(_);
assert (f1(t)._5 == 6);
}