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
16 lines
327 B
Rust
16 lines
327 B
Rust
fn wrapper3<copy T>(i: T, j: int) {
|
|
log i;
|
|
log j;
|
|
// This is a regression test that the spawn3 thunk to wrapper3
|
|
// correctly finds the value of j
|
|
assert j == 123456789;
|
|
}
|
|
|
|
fn spawn3<copy T>(i: T, j: int) {
|
|
let wrapped = bind wrapper3(i, j);
|
|
wrapped();
|
|
}
|
|
|
|
fn main() {
|
|
spawn3(127u8, 123456789);
|
|
} |