Skip to content

Commit bc659d8

Browse files
committed
---
yaml --- r: 48090 b: refs/heads/incoming c: 826644e h: refs/heads/master v: v3
1 parent 85f0c49 commit bc659d8

File tree

130 files changed

+1201
-1052
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+1201
-1052
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: 2a8fb58d79e685d5ca07b039badcf2ae3ef077ea
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/incoming: 542119f61f376fa71bfc4b34fbb25be604279dc4
9+
refs/heads/incoming: 826644e8cb37363a4e44561a498e79acfeb77b6a
1010
refs/heads/dist-snap: 8b98e5a296d95c5e832db0756828e5bec31c6f50
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/doc/rust.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1360,7 +1360,7 @@ Functions within foreign modules are declared in the same way as other Rust func
13601360
with the exception that they may not have a body and are instead terminated by a semicolon.
13611361

13621362
~~~
1363-
# use core::libc::{c_char, FILE};
1363+
# use libc::{c_char, FILE};
13641364
# #[nolink]
13651365
13661366
extern mod c {

branches/incoming/doc/tutorial-ffi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ should compile and run without any extra effort.
1414

1515
~~~~ {.xfail-test}
1616
extern mod std;
17-
use core::libc::c_uint;
17+
use libc::c_uint;
1818
1919
extern mod crypto {
2020
fn SHA1(src: *u8, sz: c_uint, out: *u8) -> *u8;
@@ -217,7 +217,7 @@ microsecond-resolution timer.
217217

218218
~~~~
219219
extern mod std;
220-
use core::libc::c_ulonglong;
220+
use libc::c_ulonglong;
221221
222222
struct timeval {
223223
tv_sec: c_ulonglong,

branches/incoming/doc/tutorial-tasks.md

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ calling the `spawn` function with a closure argument. `spawn` executes the
8080
closure in the new task.
8181

8282
~~~~
83-
# use core::io::println;
84-
use core::task::spawn;
83+
# use io::println;
84+
use task::spawn;
8585
8686
// Print something profound in a different task using a named function
8787
fn print_message() { println("I am running in a different task!"); }
@@ -110,8 +110,8 @@ execution. Like any closure, the function passed to `spawn` may capture
110110
an environment that it carries across tasks.
111111

112112
~~~
113-
# use core::io::println;
114-
# use core::task::spawn;
113+
# use io::println;
114+
# use task::spawn;
115115
# fn generate_task_number() -> int { 0 }
116116
// Generate some state locally
117117
let child_task_number = generate_task_number();
@@ -127,8 +127,8 @@ in parallel. Thus, on a multicore machine, running the following code
127127
should interleave the output in vaguely random order.
128128

129129
~~~
130-
# use core::io::print;
131-
# use core::task::spawn;
130+
# use io::print;
131+
# use task::spawn;
132132
133133
for int::range(0, 20) |child_task_number| {
134134
do spawn {
@@ -156,8 +156,8 @@ endpoint. Consider the following example of calculating two results
156156
concurrently:
157157

158158
~~~~
159-
use core::task::spawn;
160-
use core::comm::{stream, Port, Chan};
159+
use task::spawn;
160+
use comm::{stream, Port, Chan};
161161
162162
let (port, chan): (Port<int>, Chan<int>) = stream();
163163
@@ -178,7 +178,7 @@ stream for sending and receiving integers (the left-hand side of the `let`,
178178
a tuple into its component parts).
179179

180180
~~~~
181-
# use core::comm::{stream, Chan, Port};
181+
# use comm::{stream, Chan, Port};
182182
let (port, chan): (Port<int>, Chan<int>) = stream();
183183
~~~~
184184

@@ -187,8 +187,9 @@ which will wait to receive the data on the port. The next statement
187187
spawns the child task.
188188

189189
~~~~
190-
# use core::task::spawn;
191-
# use core::comm::{stream, Port, Chan};
190+
# use task::{spawn};
191+
# use task::spawn;
192+
# use comm::{stream, Port, Chan};
192193
# fn some_expensive_computation() -> int { 42 }
193194
# let (port, chan) = stream();
194195
do spawn || {
@@ -208,7 +209,7 @@ computation, then waits for the child's result to arrive on the
208209
port:
209210

210211
~~~~
211-
# use core::comm::{stream, Port, Chan};
212+
# use comm::{stream, Port, Chan};
212213
# fn some_other_expensive_computation() {}
213214
# let (port, chan) = stream::<int>();
214215
# chan.send(0);
@@ -223,8 +224,8 @@ example needed to compute multiple results across a number of tasks? The
223224
following program is ill-typed:
224225

225226
~~~ {.xfail-test}
226-
# use core::task::{spawn};
227-
# use core::comm::{stream, Port, Chan};
227+
# use task::{spawn};
228+
# use comm::{stream, Port, Chan};
228229
# fn some_expensive_computation() -> int { 42 }
229230
let (port, chan) = stream();
230231
@@ -243,8 +244,8 @@ Instead we can use a `SharedChan`, a type that allows a single
243244
`Chan` to be shared by multiple senders.
244245

245246
~~~
246-
# use core::task::spawn;
247-
use core::comm::{stream, SharedChan};
247+
# use task::spawn;
248+
use comm::{stream, SharedChan};
248249
249250
let (port, chan) = stream();
250251
let chan = SharedChan(chan);
@@ -276,8 +277,8 @@ illustrate the point. For reference, written with multiple streams, it
276277
might look like the example below.
277278

278279
~~~
279-
# use core::task::spawn;
280-
# use core::comm::{stream, Port, Chan};
280+
# use task::spawn;
281+
# use comm::{stream, Port, Chan};
281282
282283
// Create a vector of ports, one for each child task
283284
let ports = do vec::from_fn(3) |init_val| {
@@ -308,7 +309,7 @@ All tasks are, by default, _linked_ to each other. That means that the fates
308309
of all tasks are intertwined: if one fails, so do all the others.
309310

310311
~~~
311-
# use core::task::spawn;
312+
# use task::spawn;
312313
# fn do_some_work() { loop { task::yield() } }
313314
# do task::try {
314315
// Create a child task that fails
@@ -392,8 +393,8 @@ internally, with additional logic to wait for the child task to finish
392393
before returning. Hence:
393394

394395
~~~
395-
# use core::comm::{stream, Chan, Port};
396-
# use core::task::{spawn, try};
396+
# use comm::{stream, Chan, Port};
397+
# use task::{spawn, try};
397398
# fn sleep_forever() { loop { task::yield() } }
398399
# do task::try {
399400
let (receiver, sender): (Port<int>, Chan<int>) = stream();
@@ -488,8 +489,8 @@ response itself is simply the stringified version of the received value,
488489
Here is the code for the parent task:
489490

490491
~~~~
491-
# use core::task::spawn;
492492
# use std::comm::DuplexStream;
493+
# use task::spawn;
493494
# fn stringifier(channel: &DuplexStream<~str, uint>) {
494495
# let mut value: uint;
495496
# loop {

branches/incoming/doc/tutorial.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1313,7 +1313,7 @@ and [`core::str`]. Here are some examples.
13131313
[`core::str`]: core/str.html
13141314

13151315
~~~
1316-
# use core::io::println;
1316+
# use io::println;
13171317
# enum Crayon {
13181318
# Almond, AntiqueBrass, Apricot,
13191319
# Aquamarine, Asparagus, AtomicTangerine,
@@ -1368,7 +1368,7 @@ Rust also supports _closures_, functions that can access variables in
13681368
the enclosing scope.
13691369

13701370
~~~~
1371-
# use println = core::io::println;
1371+
# use println = io::println;
13721372
fn call_closure_with_ten(b: fn(int)) { b(10); }
13731373
13741374
let captured_var = 20;
@@ -1525,7 +1525,7 @@ words, it is a function that takes an owned closure that takes no
15251525
arguments.
15261526

15271527
~~~~
1528-
use core::task::spawn;
1528+
use task::spawn;
15291529
15301530
do spawn() || {
15311531
debug!("I'm a task, whatever");
@@ -1537,7 +1537,7 @@ lists back to back. Since that is so unsightly, empty argument lists
15371537
may be omitted from `do` expressions.
15381538

15391539
~~~~
1540-
# use core::task::spawn;
1540+
# use task::spawn;
15411541
do spawn {
15421542
debug!("Kablam!");
15431543
}
@@ -1568,8 +1568,8 @@ fn each(v: &[int], op: fn(v: &int) -> bool) {
15681568
And using this function to iterate over a vector:
15691569

15701570
~~~~
1571-
# use each = core::vec::each;
1572-
# use println = core::io::println;
1571+
# use each = vec::each;
1572+
# use println = io::println;
15731573
each([2, 4, 8, 5, 16], |n| {
15741574
if *n % 2 != 0 {
15751575
println("found odd number!");
@@ -1585,8 +1585,8 @@ out of the loop, you just write `break`. To skip ahead
15851585
to the next iteration, write `loop`.
15861586

15871587
~~~~
1588-
# use each = core::vec::each;
1589-
# use println = core::io::println;
1588+
# use each = vec::each;
1589+
# use println = io::println;
15901590
for each([2, 4, 8, 5, 16]) |n| {
15911591
if *n % 2 != 0 {
15921592
println("found odd number!");
@@ -1601,7 +1601,7 @@ normally allowed in closures, in a block that appears as the body of a
16011601
the enclosing function, not just the loop body.
16021602

16031603
~~~~
1604-
# use each = core::vec::each;
1604+
# use each = vec::each;
16051605
fn contains(v: &[int], elt: int) -> bool {
16061606
for each(v) |x| {
16071607
if (*x == elt) { return true; }
@@ -1616,7 +1616,7 @@ In these situations it can be convenient to lean on Rust's
16161616
argument patterns to bind `x` to the actual value, not the pointer.
16171617

16181618
~~~~
1619-
# use each = core::vec::each;
1619+
# use each = vec::each;
16201620
# fn contains(v: &[int], elt: int) -> bool {
16211621
for each(v) |&x| {
16221622
if (x == elt) { return true; }
@@ -1758,8 +1758,8 @@ Constructors are one common application for static methods, as in `new` above.
17581758
To call a static method, you have to prefix it with the type name and a double colon:
17591759

17601760
~~~~
1761-
# use core::float::consts::pi;
1762-
# use core::float::sqrt;
1761+
# use float::consts::pi;
1762+
# use float::sqrt;
17631763
struct Circle { radius: float }
17641764
impl Circle {
17651765
static fn new(area: float) -> Circle { Circle { radius: sqrt(area / pi) } }
@@ -2030,8 +2030,8 @@ The compiler will use type inference to decide which implementation to call.
20302030

20312031
~~~~
20322032
trait Shape { static fn new(area: float) -> Self; }
2033-
# use core::float::consts::pi;
2034-
# use core::float::sqrt;
2033+
# use float::consts::pi;
2034+
# use float::sqrt;
20352035
struct Circle { radius: float }
20362036
struct Square { length: float }
20372037
@@ -2189,8 +2189,8 @@ Now, we can implement `Circle` on a type only if we also implement `Shape`.
21892189
# trait Shape { fn area(&self) -> float; }
21902190
# trait Circle : Shape { fn radius(&self) -> float; }
21912191
# struct Point { x: float, y: float }
2192-
# use core::float::consts::pi;
2193-
# use core::float::sqrt;
2192+
# use float::consts::pi;
2193+
# use float::sqrt;
21942194
# fn square(x: float) -> float { x * x }
21952195
struct CircleStruct { center: Point, radius: float }
21962196
impl Circle for CircleStruct {
@@ -2224,8 +2224,8 @@ Likewise, supertrait methods may also be called on trait objects.
22242224
~~~ {.xfail-test}
22252225
# trait Shape { fn area(&self) -> float; }
22262226
# trait Circle : Shape { fn radius(&self) -> float; }
2227-
# use core::float::consts::pi;
2228-
# use core::float::sqrt;
2227+
# use float::consts::pi;
2228+
# use float::sqrt;
22292229
# struct Point { x: float, y: float }
22302230
# struct CircleStruct { center: Point, radius: float }
22312231
# impl Circle for CircleStruct { fn radius(&self) -> float { sqrt(self.area() / pi) } }

branches/incoming/src/compiletest/compiletest.rc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,18 @@ extern mod std(vers = "0.6");
2222

2323
use core::*;
2424

25-
pub mod procsrv;
26-
pub mod util;
27-
pub mod header;
28-
pub mod runtest;
29-
pub mod common;
30-
pub mod errors;
25+
mod procsrv;
26+
mod util;
27+
mod header;
28+
mod runtest;
29+
mod common;
30+
mod errors;
3131

3232
use std::getopts;
3333
use std::test;
3434

3535
use core::{result, either};
36-
use core::result::{Ok, Err};
36+
use result::{Ok, Err};
3737

3838
use common::config;
3939
use common::mode_run_pass;

branches/incoming/src/compiletest/errors.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@
1111
use core::prelude::*;
1212

1313
use common::config;
14-
15-
use core::io;
16-
use core::io::ReaderUtil;
17-
use core::str;
14+
use io;
15+
use io::ReaderUtil;
16+
use str;
1817

1918
pub struct ExpectedError { line: uint, kind: ~str, msg: ~str }
2019

branches/incoming/src/compiletest/header.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,10 @@ use core::prelude::*;
1212

1313
use common;
1414
use common::config;
15-
16-
use core::io::ReaderUtil;
17-
use core::io;
18-
use core::os;
19-
use core::str;
15+
use io;
16+
use io::ReaderUtil;
17+
use os;
18+
use str;
2019

2120
pub struct TestProps {
2221
// Lines that should be expected, in order, on standard out

branches/incoming/src/compiletest/procsrv.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@
1010

1111
use core::prelude::*;
1212

13-
use core::io::{ReaderUtil, WriterUtil};
14-
use core::io;
15-
use core::libc::{c_int, pid_t};
16-
use core::libc;
17-
use core::os;
18-
use core::pipes;
19-
use core::run::spawn_process;
20-
use core::run;
21-
use core::str;
22-
use core::task;
23-
use core::vec;
13+
use io;
14+
use io::{ReaderUtil, WriterUtil};
15+
use libc;
16+
use libc::{c_int, pid_t};
17+
use os;
18+
use run;
19+
use run::spawn_process;
20+
use pipes;
21+
use str;
22+
use task;
23+
use vec;
2424

2525
#[cfg(target_os = "win32")]
2626
fn target_env(lib_path: ~str, prog: ~str) -> ~[(~str,~str)] {

0 commit comments

Comments
 (0)