Skip to content

Commit 6ada5e2

Browse files
committed
---
yaml --- r: 62845 b: refs/heads/snap-stage3 c: 8eb358b h: refs/heads/master i: 62843: 0613019 v: v3
1 parent d7b294d commit 6ada5e2

File tree

674 files changed

+2306
-3832
lines changed

Some content is hidden

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

674 files changed

+2306
-3832
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 395685079a2ef21c93a90ff6ccac2873b3013c7f
4+
refs/heads/snap-stage3: 8eb358bb00f161f9e289de6cad8cfecc4c6eb681
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/doc/rust.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1840,7 +1840,6 @@ is bounds-checked at run-time. When the check fails, it will put the
18401840
task in a _failing state_.
18411841

18421842
~~~~
1843-
# use std::task;
18441843
# do task::spawn_unlinked {
18451844
18461845
([1, 2, 3, 4])[0];
@@ -2169,7 +2168,7 @@ fn ten_times(f: &fn(int)) {
21692168
}
21702169
}
21712170
2172-
ten_times(|j| println(fmt!("hello, %d", j)));
2171+
ten_times(|j| io::println(fmt!("hello, %d", j)));
21732172
21742173
~~~~
21752174

@@ -2190,7 +2189,7 @@ An example:
21902189
let mut i = 0;
21912190
21922191
while i < 10 {
2193-
println("hello\n");
2192+
io::println("hello\n");
21942193
i = i + 1;
21952194
}
21962195
~~~~
@@ -2336,7 +2335,6 @@ for v.each |e| {
23362335
An example of a for loop over a series of integers:
23372336

23382337
~~~~
2339-
# use std::uint;
23402338
# fn bar(b:uint) { }
23412339
for uint::range(0, 256) |i| {
23422340
bar(i);
@@ -2800,7 +2798,6 @@ the vtable pointer for the `T` implementation of `R`, and the pointer value of `
28002798
An example of an object type:
28012799

28022800
~~~~~~~~
2803-
# use std::int;
28042801
trait Printable {
28052802
fn to_str(&self) -> ~str;
28062803
}
@@ -2810,7 +2807,7 @@ impl Printable for int {
28102807
}
28112808
28122809
fn print(a: @Printable) {
2813-
println(a.to_str());
2810+
io::println(a.to_str());
28142811
}
28152812
28162813
fn main() {

branches/snap-stage3/doc/tutorial-ffi.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,7 @@ A type with the same functionality as owned boxes can be implemented by
149149
wrapping `malloc` and `free`:
150150

151151
~~~~
152-
use std::cast;
153152
use std::libc::{c_void, size_t, malloc, free};
154-
use std::ptr;
155153
use std::unstable::intrinsics;
156154
use std::util;
157155

branches/snap-stage3/doc/tutorial-tasks.md

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ should interleave the output in vaguely random order.
120120
~~~
121121
# use std::io::print;
122122
# use std::task::spawn;
123-
# use std::int;
124123
125124
for int::range(0, 20) |child_task_number| {
126125
do spawn {
@@ -237,7 +236,6 @@ Instead we can use a `SharedChan`, a type that allows a single
237236
~~~
238237
# use std::task::spawn;
239238
# use std::comm::{stream, SharedChan};
240-
# use std::uint;
241239
242240
let (port, chan) = stream();
243241
let chan = SharedChan::new(chan);
@@ -271,7 +269,6 @@ might look like the example below.
271269
~~~
272270
# use std::task::spawn;
273271
# use std::comm::stream;
274-
# use std::vec;
275272
276273
// Create a vector of ports, one for each child task
277274
let ports = do vec::from_fn(3) |init_val| {
@@ -313,8 +310,6 @@ the future needs to be mutable so that it can save the result for next time `get
313310
Here is another example showing how futures allow you to background computations. The workload will
314311
be distributed on the available cores.
315312
~~~
316-
# use std::vec;
317-
# use std::uint;
318313
fn partial_sum(start: uint) -> f64 {
319314
let mut local_sum = 0f64;
320315
for uint::range(start*100000, (start+1)*100000) |num| {
@@ -348,17 +343,14 @@ acts as a reference to the shared data and only this reference is shared and clo
348343
Here is a small example showing how to use ARCs. We wish to run concurrently several computations on
349344
a single large vector of floats. Each task needs the full vector to perform its duty.
350345
~~~
351-
# use std::vec;
352-
# use std::uint;
353-
# use std::rand;
354346
use extra::arc::ARC;
355347
356348
fn pnorm(nums: &~[float], p: uint) -> float {
357349
(vec::foldl(0.0, *nums, |a,b| a+(*b).pow(p as float) )).pow(1f / (p as float))
358350
}
359351
360352
fn main() {
361-
let numbers = vec::from_fn(1000000, |_| rand::random::<float>());
353+
let numbers=vec::from_fn(1000000, |_| rand::random::<float>());
362354
println(fmt!("Inf-norm = %?", numbers.max()));
363355
364356
let numbers_arc = ARC(numbers);
@@ -381,16 +373,12 @@ at the power given as argument and takes the inverse power of this value). The A
381373
created by the line
382374
~~~
383375
# use extra::arc::ARC;
384-
# use std::vec;
385-
# use std::rand;
386-
# let numbers = vec::from_fn(1000000, |_| rand::random::<float>());
376+
# let numbers=vec::from_fn(1000000, |_| rand::random::<float>());
387377
let numbers_arc=ARC(numbers);
388378
~~~
389379
and a clone of it is sent to each task
390380
~~~
391381
# use extra::arc::ARC;
392-
# use std::vec;
393-
# use std::rand;
394382
# let numbers=vec::from_fn(1000000, |_| rand::random::<float>());
395383
# let numbers_arc = ARC(numbers);
396384
# let (port, chan) = stream();
@@ -401,8 +389,6 @@ copying only the wrapper and not its contents.
401389
Each task recovers the underlying data by
402390
~~~
403391
# use extra::arc::ARC;
404-
# use std::vec;
405-
# use std::rand;
406392
# let numbers=vec::from_fn(1000000, |_| rand::random::<float>());
407393
# let numbers_arc=ARC(numbers);
408394
# let (port, chan) = stream();
@@ -430,7 +416,6 @@ of all tasks are intertwined: if one fails, so do all the others.
430416

431417
~~~
432418
# use std::task::spawn;
433-
# use std::task;
434419
# fn do_some_work() { loop { task::yield() } }
435420
# do task::try {
436421
// Create a child task that fails
@@ -452,7 +437,6 @@ field (representing a successful result) or an `Err` result (representing
452437
termination with an error).
453438

454439
~~~
455-
# use std::task;
456440
# fn some_condition() -> bool { false }
457441
# fn calculate_result() -> int { 0 }
458442
let result: Result<int, ()> = do task::try {
@@ -495,7 +479,6 @@ By default, task failure is _bidirectionally linked_, which means that if
495479
either task fails, it kills the other one.
496480

497481
~~~
498-
# use std::task;
499482
# fn sleep_forever() { loop { task::yield() } }
500483
# do task::try {
501484
do spawn {
@@ -518,7 +501,6 @@ before returning. Hence:
518501
~~~
519502
# use std::comm::{stream, Chan, Port};
520503
# use std::task::{spawn, try};
521-
# use std::task;
522504
# fn sleep_forever() { loop { task::yield() } }
523505
# do task::try {
524506
let (receiver, sender): (Port<int>, Chan<int>) = stream();
@@ -546,7 +528,6 @@ Supervised task failure propagates across multiple generations even if
546528
an intermediate generation has already exited:
547529

548530
~~~
549-
# use std::task;
550531
# fn sleep_forever() { loop { task::yield() } }
551532
# fn wait_for_a_while() { for 1000.times { task::yield() } }
552533
# do task::try::<int> {
@@ -565,7 +546,6 @@ Finally, tasks can be configured to not propagate failure to each
565546
other at all, using `task::spawn_unlinked` for _isolated failure_.
566547

567548
~~~
568-
# use std::task;
569549
# fn random() -> uint { 100 }
570550
# fn sleep_for(i: uint) { for i.times { task::yield() } }
571551
# do task::try::<()> {
@@ -594,7 +574,6 @@ Here is the function that implements the child task:
594574

595575
~~~~
596576
# use extra::comm::DuplexStream;
597-
# use std::uint;
598577
fn stringifier(channel: &DuplexStream<~str, uint>) {
599578
let mut value: uint;
600579
loop {
@@ -617,7 +596,6 @@ Here is the code for the parent task:
617596

618597
~~~~
619598
# use std::task::spawn;
620-
# use std::uint;
621599
# use extra::comm::DuplexStream;
622600
# fn stringifier(channel: &DuplexStream<~str, uint>) {
623601
# let mut value: uint;

branches/snap-stage3/doc/tutorial.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,6 @@ types.
502502
> items.
503503
504504
~~~~
505-
# use std::float;
506505
fn angle(vector: (float, float)) -> float {
507506
let pi = float::consts::pi;
508507
match vector {
@@ -557,7 +556,6 @@ while cake_amount > 0 {
557556
`loop` denotes an infinite loop, and is the preferred way of writing `while true`:
558557

559558
~~~~
560-
# use std::int;
561559
let mut x = 5;
562560
loop {
563561
x += x - 3;
@@ -701,7 +699,6 @@ get at their contents. All variant constructors can be used as
701699
patterns, as in this definition of `area`:
702700

703701
~~~~
704-
# use std::float;
705702
# struct Point {x: float, y: float}
706703
# enum Shape { Circle(Point, float), Rectangle(Point, Point) }
707704
fn area(sh: Shape) -> float {
@@ -1832,7 +1829,6 @@ vector consisting of the result of applying `function` to each element
18321829
of `vector`:
18331830

18341831
~~~~
1835-
# use std::vec;
18361832
fn map<T, U>(vector: &[T], function: &fn(v: &T) -> U) -> ~[U] {
18371833
let mut accumulator = ~[];
18381834
for vec::each(vector) |element| {
@@ -2030,7 +2026,6 @@ themselves contain type parameters. A trait for generalized sequence
20302026
types might look like the following:
20312027

20322028
~~~~
2033-
# use std::vec;
20342029
trait Seq<T> {
20352030
fn len(&self) -> uint;
20362031
fn iter(&self, b: &fn(v: &T));

branches/snap-stage3/src/compiletest/compiletest.rc

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
#[no_std];
1717

1818
extern mod core(name = "std", vers = "0.7-pre");
19-
extern mod extra(name = "extra", vers = "0.7-pre");
19+
extern mod std(name = "extra", vers = "0.7-pre");
2020

2121
use core::prelude::*;
2222
use core::*;
2323

24-
use extra::getopts;
25-
use extra::test;
24+
use std::getopts;
25+
use std::test;
2626

2727
use core::result::{Ok, Err};
2828

@@ -42,13 +42,6 @@ pub mod runtest;
4242
pub mod common;
4343
pub mod errors;
4444

45-
mod std {
46-
pub use core::cmp;
47-
pub use core::str;
48-
pub use core::sys;
49-
pub use core::unstable;
50-
}
51-
5245
pub fn main() {
5346
let args = os::args();
5447
let config = parse_config(args);

branches/snap-stage3/src/compiletest/errors.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010

1111
use core::prelude::*;
1212

13-
use core::io;
14-
use core::str;
15-
1613
pub struct ExpectedError { line: uint, kind: ~str, msg: ~str }
1714

1815
// Load any test directives embedded in the file

branches/snap-stage3/src/compiletest/header.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,8 @@
1010

1111
use core::prelude::*;
1212

13-
use common::config;
1413
use common;
15-
16-
use core::io;
17-
use core::os;
18-
use core::str;
14+
use common::config;
1915

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

branches/snap-stage3/src/compiletest/procsrv.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,7 @@
1010

1111
use core::prelude::*;
1212

13-
use core::comm;
14-
use core::io;
15-
use core::libc::c_int;
16-
use core::os;
1713
use core::run;
18-
use core::str;
19-
use core::task;
2014

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

branches/snap-stage3/src/compiletest/runtest.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,6 @@ use procsrv;
2222
use util;
2323
use util::logv;
2424

25-
use core::io;
26-
use core::os;
27-
use core::str;
28-
use core::uint;
29-
use core::vec;
30-
3125
pub fn run(config: config, testfile: ~str) {
3226
if config.verbose {
3327
// We're going to be dumping a lot of info. Start on a new line.

branches/snap-stage3/src/compiletest/util.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ use core::prelude::*;
1212

1313
use common::config;
1414

15-
use core::io;
1615
use core::os::getenv;
1716

1817
pub fn make_new_path(path: &str) -> ~str {

branches/snap-stage3/src/etc/combine-tests.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ def scrub(b):
5353
d.write("extern mod run_pass_stage2;\n")
5454
d.write("use run_pass_stage2::*;\n")
5555
d.write("use std::io::WriterUtil;\n");
56-
d.write("use std::io;\n");
5756
d.write("fn main() {\n");
5857
d.write(" let out = io::stdout();\n");
5958
i = 0

0 commit comments

Comments
 (0)