You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ok, so I did a little more investigating. Moving the chan/port into the function works, however that does mean that you now can't use it inside a heap closure, as you cannot move out of a heap closure (like, oh, I don't know the most common way of spawning a new task).
I.E. This works:
let (chan, port) = pipes::oneshot();
pipes::send_one(move chan, true);
but this does not:
let (chan, port) = pipes::oneshot();
task::spawn |move chan| {
pipes::send_one(chan, true);
//pipes::send_one(move chan, true);// Neither work
}
I'm not sure how this should be fixed now though, since channels/ports shouldn't be copyable but you also need to handle the second case above. Maybe some liveness stuff?
pipes::send_one
andpipes::recv_one
(and related functions) throw this error:copying a non-copyable variable
.This is the minimum code to reproduce it:
That will fail on the second line.
This is actually a big problem, since
core::comm
is deprecated I don't really have another way to do this kind of communication.The text was updated successfully, but these errors were encountered: