2012-09-24 19:29:20 -05:00
|
|
|
#[legacy_exports];
|
|
|
|
|
2012-05-29 19:48:27 -05:00
|
|
|
export foo;
|
|
|
|
|
2012-09-05 14:32:05 -05:00
|
|
|
use comm::*;
|
2012-05-29 19:48:27 -05:00
|
|
|
|
2012-09-07 16:52:28 -05:00
|
|
|
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| {
|
2012-05-29 19:48:27 -05:00
|
|
|
c.send(x);
|
|
|
|
}
|
|
|
|
p
|
|
|
|
}
|