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

11 lines
179 B
Rust
Raw Normal View History

fn id<T>(t: &T) -> T { ret t; }
fn main() {
2011-07-27 07:19:39 -05:00
let t = {a: 1, b: 2, c: 3, d: 4, e: 5, f: 6, g: 7};
assert (t.f == 6);
2011-07-27 07:19:39 -05:00
let f0 = bind id(t);
assert (f0().f == 6);
}