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
9 lines
168 B
Rust
9 lines
168 B
Rust
|
|
obj ob<copy K>(k: K) {
|
|
fn foo(it: block(~{a: K})) { it(~{a: k}); }
|
|
}
|
|
|
|
fn x(o: ob<str>) { o.foo() {|_i|}; }
|
|
|
|
fn main() { let o = ob::<str>("hi" + "there"); x(o); }
|