Skip to content

Commit b0fc222

Browse files
committed
Fix broken tests
1 parent a9601bc commit b0fc222

File tree

1 file changed

+3
-63
lines changed

1 file changed

+3
-63
lines changed

doc/rust.md

Lines changed: 3 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -858,13 +858,14 @@ If a sequence of such redirections form a cycle or cannot be unambiguously resol
858858

859859
An example of re-exporting:
860860
~~~~
861+
# fn main() { }
861862
mod quux {
862-
mod foo {
863+
pub mod foo {
863864
pub fn bar() { }
864865
pub fn baz() { }
865866
}
866867
867-
pub use foo::*;
868+
pub use quux::foo::*;
868869
}
869870
~~~~
870871

@@ -3036,67 +3037,6 @@ An executing task can yield control at any time, by making a library call to
30363037
non-executing state (blocked, dead) similarly deschedules the task.
30373038

30383039

3039-
### Spawning tasks
3040-
3041-
A call to `core::task::spawn`, passing a 0-argument function as its single
3042-
argument, causes the runtime to construct a new task executing the passed
3043-
function. The passed function is referred to as the _entry function_ for
3044-
the spawned task, and any captured environment it carries is moved from the
3045-
spawning task to the spawned task before the spawned task begins execution.
3046-
3047-
The result of a `spawn` call is a `core::task::Task` value.
3048-
3049-
An example of a `spawn` call:
3050-
3051-
~~~~
3052-
let po = comm::Port();
3053-
let ch = comm::Chan(&po);
3054-
3055-
do task::spawn {
3056-
// let task run, do other things
3057-
...
3058-
comm::send(ch, true);
3059-
};
3060-
3061-
let result = comm::recv(po);
3062-
~~~~
3063-
3064-
3065-
### Sending values into channels
3066-
3067-
Sending a value into a channel is done by a library call to `core::comm::send`,
3068-
which takes a channel and a value to send, and moves the value into the
3069-
channel's outgoing buffer.
3070-
3071-
An example of a send:
3072-
3073-
~~~~
3074-
let po = comm::Port();
3075-
let ch = comm::Chan(&po);
3076-
comm::send(ch, ~"hello, world");
3077-
~~~~
3078-
3079-
3080-
### Receiving values from ports
3081-
3082-
Receiving a value is done by a call to the `recv` method on a value of type
3083-
`core::comm::Port`. This call causes the receiving task to enter the *blocked
3084-
reading* state until a value arrives in the port's receive queue, at which
3085-
time the port deques a value to return, and un-blocks the receiving task.
3086-
3087-
An example of a *receive*:
3088-
3089-
~~~~~~~~
3090-
# let po = comm::Port();
3091-
# let ch = comm::Chan(&po);
3092-
# comm::send(ch, ~"");
3093-
let s = comm::recv(po);
3094-
~~~~~~~~
3095-
3096-
> **Note:** this communication system will be replaced by a higher-performance system called "pipes",
3097-
> in future versions of Rust.
3098-
3099-
31003040
# Runtime services, linkage and debugging
31013041

31023042

0 commit comments

Comments
 (0)