Ah, thanks! Section 2.1 of this tutorial (
http://static.rust-lang.org/doc/tutorial-tasks.html) should probably be
updated to make it clear that ports are (at least, temporarily) unsendable.
I'm glad to see that there is a solid reason for the compiler error
message. Bugs in a compiler are never fun.


On Mon, Jul 8, 2013 at 1:24 PM, Brian Anderson <[email protected]>wrote:

> On 07/08/2013 06:43 AM, Josh Leverette wrote:
>
>>
>> extern mod std;
>> extern mod extra;
>> use std::{task, io};
>> use extra::flatpipes;
>>
>> fn main() {
>>     let (port, chan) = flatpipes::serial::pipe_**stream();
>>     let portBox = ~port;
>>     do task::spawn || {
>>         let val = portBox.recv();
>>         io::println(fmt!("Value: %?", val));
>>     }
>>     let value = @[1, 2, 3, 4, 5];
>>     chan.send(value);
>> }
>>
>
> The problem is that an @-box was added to the PipeBytePort type, which
> makes it unsendable, so at the moment flatpipe ports cannot be sent.
> Channels are still sendable. Here's the definition in question:
>
>     pub struct PipeBytePort {
>         port: comm::Port<~[u8]>,
>         buf: @mut ~[u8]
>
>     }
>
> ______________________________**_________________
> Rust-dev mailing list
> [email protected]
> https://mail.mozilla.org/**listinfo/rust-dev<https://mail.mozilla.org/listinfo/rust-dev>
>



-- 
Sincerely,
    Josh
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to