-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SharedChan in Tasks and Communication Tutorial #9573
Comments
It is, but you have to Tutorial will need fixing of course. |
Ah thanks, that works! Just checked the markdown source for the tutorial and it includes:
But that's not rendered on the html version. On Fri, Sep 27, 2013 at 8:33 PM, Jack Moffitt notifications@git.luolix.topwrote:
|
This can be closed, the following code is from the tutorial and works as expected (without explicit imports): fn main() {
// single sender and receiver
let (port, chan): (Port<int>, Chan<int>) = Chan::new();
do spawn {
chan.send(5);
}
println!("{:d}", port.recv());
// multiple senders
let (port, chan) = SharedChan::new();
for i in range(0, 3) {
let child_chan = chan.clone();
do spawn {
child_chan.send(i);
}
}
println!("{:d} {:d} {:d}", port.recv(), port.recv(), port.recv());
} |
… r=dswij lint nested patterns and slice patterns in `needless_borrowed_reference` Now lints in positions other than top level, e.g. `Some(&ref a)`. Or patterns are excluded as that can cause issues Slice patterns of `ref`s are now linted, e.g. `&[ref a, ref b]`. An easy one to walk into as you might expect that to match against a slice you should use `&[]`, then to get around a `cannot move out of type [T]` error you apply a `ref` changelog: [`needless_borrowed_reference`]: lint nested patterns and slice patterns
Hello,
I am reading the Rust Tasks and Communication Tutorial and I am trying to run the following code:
I thought
SharedChan
was defined instd::comm
?Thanks
The text was updated successfully, but these errors were encountered: