f6491bb426
This involved adding 'copy' to more generics than I hoped, but an experiment with making it implicit showed that that way lies madness -- unless enforced, you will not remember to mark functions that don't copy as not requiring copyable kind. Issue #1177
11 lines
183 B
Rust
11 lines
183 B
Rust
|
|
|
|
fn id<copy T>(t: T) -> T { ret t; }
|
|
|
|
fn main() {
|
|
let t = {a: 1, b: 2, c: 3, d: 4, e: 5, f: 6, g: 7};
|
|
assert (t.f == 6);
|
|
let f0 = bind id(t);
|
|
assert (f0().f == 6);
|
|
}
|