rust/src/test/auxiliary/cci_capture_clause.rs

15 lines
202 B
Rust
Raw Normal View History

#[legacy_exports];
export foo;
2012-09-05 14:32:05 -05:00
use comm::*;
fn foo<T: Send Copy>(x: T) -> Port<T> {
2012-08-27 16:22:25 -05:00
let p = Port();
2012-10-03 16:38:01 -05:00
let c = Chan(&p);
2012-06-30 18:19:07 -05:00
do task::spawn() |copy c, copy x| {
c.send(x);
}
p
}