Skip to content

Commit 1fdd840

Browse files
committed
---
yaml --- r: 110419 b: refs/heads/try c: bb31cb8 h: refs/heads/master i: 110417: 1e96c30 110415: 412977f v: v3
1 parent ffbeddb commit 1fdd840

File tree

324 files changed

+3425
-4546
lines changed

Some content is hidden

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

324 files changed

+3425
-4546
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: e415c25bcd81dc1f9a5a3d25d9b48ed2d545336b
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: c7fac4471201977fdb1c0c0a26c87287e12dc644
5-
refs/heads/try: 46867cc3e4ddcbb1d359a315805de00094dacaf9
5+
refs/heads/try: bb31cb8d2e4e415cbb71d368918d72902e655e01
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/compiletest/common.rs

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -21,87 +21,87 @@ pub enum mode {
2121
#[deriving(Clone)]
2222
pub struct config {
2323
// The library paths required for running the compiler
24-
compile_lib_path: ~str,
24+
pub compile_lib_path: ~str,
2525

2626
// The library paths required for running compiled programs
27-
run_lib_path: ~str,
27+
pub run_lib_path: ~str,
2828

2929
// The rustc executable
30-
rustc_path: Path,
30+
pub rustc_path: Path,
3131

3232
// The clang executable
33-
clang_path: Option<Path>,
33+
pub clang_path: Option<Path>,
3434

3535
// The llvm binaries path
36-
llvm_bin_path: Option<Path>,
36+
pub llvm_bin_path: Option<Path>,
3737

3838
// The directory containing the tests to run
39-
src_base: Path,
39+
pub src_base: Path,
4040

4141
// The directory where programs should be built
42-
build_base: Path,
42+
pub build_base: Path,
4343

4444
// Directory for auxiliary libraries
45-
aux_base: Path,
45+
pub aux_base: Path,
4646

4747
// The name of the stage being built (stage1, etc)
48-
stage_id: ~str,
48+
pub stage_id: ~str,
4949

5050
// The test mode, compile-fail, run-fail, run-pass
51-
mode: mode,
51+
pub mode: mode,
5252

5353
// Run ignored tests
54-
run_ignored: bool,
54+
pub run_ignored: bool,
5555

5656
// Only run tests that match this filter
57-
filter: Option<~str>,
57+
pub filter: Option<~str>,
5858

5959
// Write out a parseable log of tests that were run
60-
logfile: Option<Path>,
60+
pub logfile: Option<Path>,
6161

6262
// Write out a json file containing any metrics of the run
63-
save_metrics: Option<Path>,
63+
pub save_metrics: Option<Path>,
6464

6565
// Write and ratchet a metrics file
66-
ratchet_metrics: Option<Path>,
66+
pub ratchet_metrics: Option<Path>,
6767

6868
// Percent change in metrics to consider noise
69-
ratchet_noise_percent: Option<f64>,
69+
pub ratchet_noise_percent: Option<f64>,
7070

71-
// "Shard" of the testsuite to run: this has the form of
71+
// "Shard" of the testsuite to pub run: this has the form of
7272
// two numbers (a,b), and causes only those tests with
7373
// positional order equal to a mod b to run.
74-
test_shard: Option<(uint,uint)>,
74+
pub test_shard: Option<(uint,uint)>,
7575

7676
// A command line to prefix program execution with,
7777
// for running under valgrind
78-
runtool: Option<~str>,
78+
pub runtool: Option<~str>,
7979

8080
// Flags to pass to the compiler when building for the host
81-
host_rustcflags: Option<~str>,
81+
pub host_rustcflags: Option<~str>,
8282

8383
// Flags to pass to the compiler when building for the target
84-
target_rustcflags: Option<~str>,
84+
pub target_rustcflags: Option<~str>,
8585

8686
// Run tests using the JIT
87-
jit: bool,
87+
pub jit: bool,
8888

8989
// Target system to be tested
90-
target: ~str,
90+
pub target: ~str,
9191

9292
// Host triple for the compiler being invoked
93-
host: ~str,
93+
pub host: ~str,
9494

9595
// Extra parameter to run adb on arm-linux-androideabi
96-
adb_path: ~str,
96+
pub adb_path: ~str,
9797

9898
// Extra parameter to run test sute on arm-linux-androideabi
99-
adb_test_dir: ~str,
99+
pub adb_test_dir: ~str,
100100

101101
// status whether android device available or not
102-
adb_device_status: bool,
102+
pub adb_device_status: bool,
103103

104104
// Explain what's going on
105-
verbose: bool
105+
pub verbose: bool
106106

107107
}

branches/try/src/compiletest/errors.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@
1010

1111
use std::io::{BufferedReader, File};
1212

13-
pub struct ExpectedError { line: uint, kind: ~str, msg: ~str }
13+
pub struct ExpectedError {
14+
pub line: uint,
15+
pub kind: ~str,
16+
pub msg: ~str,
17+
}
1418

1519
// Load any test directives embedded in the file
1620
pub fn load_errors(testfile: &Path) -> Vec<ExpectedError> {

branches/try/src/compiletest/header.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,26 @@ use util;
1414

1515
pub struct TestProps {
1616
// Lines that should be expected, in order, on standard out
17-
error_patterns: Vec<~str> ,
17+
pub error_patterns: Vec<~str> ,
1818
// Extra flags to pass to the compiler
19-
compile_flags: Option<~str>,
19+
pub compile_flags: Option<~str>,
2020
// If present, the name of a file that this test should match when
2121
// pretty-printed
22-
pp_exact: Option<Path>,
22+
pub pp_exact: Option<Path>,
2323
// Modules from aux directory that should be compiled
24-
aux_builds: Vec<~str> ,
24+
pub aux_builds: Vec<~str> ,
2525
// Environment settings to use during execution
26-
exec_env: Vec<(~str,~str)> ,
26+
pub exec_env: Vec<(~str,~str)> ,
2727
// Commands to be given to the debugger, when testing debug info
28-
debugger_cmds: Vec<~str> ,
28+
pub debugger_cmds: Vec<~str> ,
2929
// Lines to check if they appear in the expected debugger output
30-
check_lines: Vec<~str> ,
30+
pub check_lines: Vec<~str> ,
3131
// Flag to force a crate to be built with the host architecture
32-
force_host: bool,
32+
pub force_host: bool,
3333
// Check stdout for error-pattern output as well as stderr
34-
check_stdout: bool,
34+
pub check_stdout: bool,
3535
// Don't force a --crate-type=dylib flag on the command line
36-
no_prefer_dynamic: bool,
36+
pub no_prefer_dynamic: bool,
3737
}
3838

3939
// Load any test directives embedded in the file

branches/try/src/compiletest/procsrv.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ fn target_env(lib_path: &str, prog: &str) -> Vec<(~str,~str)> {
5757
return env;
5858
}
5959

60-
pub struct Result {status: ProcessExit, out: ~str, err: ~str}
60+
pub struct Result {pub status: ProcessExit, pub out: ~str, pub err: ~str}
6161

6262
pub fn run(lib_path: &str,
6363
prog: &str,

branches/try/src/doc/complement-lang-faq.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ You may also be interested in browsing [GitHub's Rust][github-rust] page.
3131

3232
## Does it run on Windows?
3333

34-
Yes. All development happens in lock-step on all 3 target platforms. Using MinGW, not Cygwin. Note that the windows implementation currently has some limitations: in particular tasks [cannot unwind on windows][unwind], and all Rust executables [require a MinGW installation at runtime][libgcc].
34+
Yes. All development happens in lock-step on all 3 target platforms. Using MinGW, not Cygwin. Note that the windows implementation currently has some limitations: in particular 64-bit build is [not fully supported yet][win64], and all executables created by rustc [depends on libgcc DLL at runtime][libgcc].
3535

36-
[unwind]: https://github.com/mozilla/rust/issues/908
37-
[libgcc]: https://github.com/mozilla/rust/issues/1603
36+
[win64]: https://github.com/mozilla/rust/issues/1237
37+
[libgcc]: https://github.com/mozilla/rust/issues/11782
3838

3939
## Is it OO? How do I do this thing I normally do in an OO language?
4040

branches/try/src/doc/guide-pointers.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -332,8 +332,6 @@ sense, they're simple: just keep whatever ownership the data already has. For
332332
example:
333333

334334
~~~rust
335-
use std::num::sqrt;
336-
337335
struct Point {
338336
x: f32,
339337
y: f32,
@@ -343,7 +341,7 @@ fn compute_distance(p1: &Point, p2: &Point) -> f32 {
343341
let x_d = p1.x - p2.x;
344342
let y_d = p1.y - p2.y;
345343

346-
sqrt(x_d * x_d + y_d * y_d)
344+
(x_d * x_d + y_d * y_d).sqrt()
347345
}
348346

349347
fn main() {

branches/try/src/doc/guide-runtime.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,7 @@ into the pool of schedulers in order to spawn a new task.
216216

217217
With two implementations of the runtime available, a choice obviously needs to
218218
be made to see which will be used. The compiler itself will always by-default
219-
link to one of these runtimes. At the time of this writing, the default runtime
220-
is `libgreen` but in the future this will become `libnative`.
219+
link to one of these runtimes.
221220

222221
Having a default decision made in the compiler is done out of necessity and
223222
convenience. The compiler's decision of runtime to link to is *not* an

branches/try/src/doc/guide-unsafe.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ use std::ptr;
200200
// Unique<T> has the same semantics as ~T
201201
pub struct Unique<T> {
202202
// It contains a single raw, mutable pointer to the object in question.
203-
priv ptr: *mut T
203+
ptr: *mut T
204204
}
205205
206206
// Implement methods for creating and using the values in the box.

branches/try/src/doc/rust.md

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -826,14 +826,14 @@ Use declarations support a number of convenient shortcuts:
826826
An example of `use` declarations:
827827

828828
~~~~
829-
use std::num::sin;
829+
use std::iter::range_step;
830830
use std::option::{Some, None};
831831
832832
# fn foo<T>(_: T){}
833833
834834
fn main() {
835-
// Equivalent to 'std::num::sin(1.0);'
836-
sin(1.0);
835+
// Equivalent to 'std::iter::range_step(0, 10, 2);'
836+
range_step(0, 10, 2);
837837
838838
// Equivalent to 'foo(~[std::option::Some(1.0), std::option::None]);'
839839
foo(~[Some(1.0), None]);
@@ -1527,12 +1527,9 @@ of an item to see whether it should be allowed or not. This is where privacy
15271527
warnings are generated, or otherwise "you used a private item of another module
15281528
and weren't allowed to."
15291529

1530-
By default, everything in rust is *private*, with two exceptions. The first
1531-
exception is that struct fields are public by default (but the struct itself is
1532-
still private by default), and the remaining exception is that enum variants in
1533-
a `pub` enum are the default visibility of the enum container itself.. You are
1534-
allowed to alter this default visibility with the `pub` keyword (or `priv`
1535-
keyword for struct fields and enum variants). When an item is declared as `pub`,
1530+
By default, everything in rust is *private*, with one exception. Enum variants
1531+
in a `pub` enum are also public by default. You are allowed to alter this
1532+
default visibility with the `priv` keyword. When an item is declared as `pub`,
15361533
it can be thought of as being accessible to the outside world. For example:
15371534

15381535
~~~~
@@ -1542,7 +1539,7 @@ struct Foo;
15421539
15431540
// Declare a public struct with a private field
15441541
pub struct Bar {
1545-
priv field: int
1542+
field: int
15461543
}
15471544
15481545
// Declare a public enum with public and private variants
@@ -2354,7 +2351,7 @@ The following are examples of structure expressions:
23542351
~~~~
23552352
# struct Point { x: f64, y: f64 }
23562353
# struct TuplePoint(f64, f64);
2357-
# mod game { pub struct User<'a> { name: &'a str, age: uint, score: uint } }
2354+
# mod game { pub struct User<'a> { pub name: &'a str, pub age: uint, pub score: uint } }
23582355
# struct Cookie; fn some_fn<T>(t: T) {}
23592356
Point {x: 10.0, y: 20.0};
23602357
TuplePoint(10.0, 20.0);
@@ -3140,7 +3137,7 @@ The types `char` and `str` hold textual data.
31403137
A value of type `char` is a [Unicode scalar value](
31413138
http://www.unicode.org/glossary/#unicode_scalar_value)
31423139
(ie. a code point that is not a surrogate),
3143-
represented as a 32-bit unsigned word in the 0x0000 to 0xD7FF
3140+
represented as a 32-bit unsigned word in the 0x0000 to 0xD7FF
31443141
or 0xE000 to 0x10FFFF range.
31453142
A `[char]` vector is effectively an UCS-4 / UTF-32 string.
31463143

branches/try/src/doc/tutorial.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -504,13 +504,12 @@ matching in order to bind names to the contents of data types.
504504
505505
~~~~
506506
use std::f64;
507-
use std::num::atan;
508507
fn angle(vector: (f64, f64)) -> f64 {
509508
let pi = f64::consts::PI;
510509
match vector {
511510
(0.0, y) if y < 0.0 => 1.5 * pi,
512511
(0.0, _) => 0.5 * pi,
513-
(x, y) => atan(y / x)
512+
(x, y) => (y / x).atan()
514513
}
515514
}
516515
~~~~
@@ -1430,12 +1429,11 @@ bad, but often copies are expensive. So we’d like to define a function
14301429
that takes the points by pointer. We can use references to do this:
14311430
14321431
~~~
1433-
use std::num::sqrt;
14341432
# struct Point { x: f64, y: f64 }
14351433
fn compute_distance(p1: &Point, p2: &Point) -> f64 {
14361434
let x_d = p1.x - p2.x;
14371435
let y_d = p1.y - p2.y;
1438-
sqrt(x_d * x_d + y_d * y_d)
1436+
(x_d * x_d + y_d * y_d).sqrt()
14391437
}
14401438
~~~
14411439
@@ -2303,7 +2301,7 @@ impl Shape for Circle {
23032301
fn new(area: f64) -> Circle { Circle { radius: (area / PI).sqrt() } }
23042302
}
23052303
impl Shape for Square {
2306-
fn new(area: f64) -> Square { Square { length: (area).sqrt() } }
2304+
fn new(area: f64) -> Square { Square { length: area.sqrt() } }
23072305
}
23082306
23092307
let area = 42.5;
@@ -2657,8 +2655,8 @@ Rust doesn't support encapsulation: both struct fields and methods can
26572655
be private. But this encapsulation is at the module level, not the
26582656
struct level.
26592657

2660-
For convenience, fields are _public_ by default, and can be made _private_ with
2661-
the `priv` keyword:
2658+
Fields are _private_ by default, and can be made _public_ with
2659+
the `pub` keyword:
26622660

26632661
~~~
26642662
mod farm {
@@ -2667,8 +2665,8 @@ mod farm {
26672665
# impl Human { pub fn rest(&self) { } }
26682666
# pub fn make_me_a_farm() -> Farm { Farm { chickens: ~[], farmer: Human(0) } }
26692667
pub struct Farm {
2670-
priv chickens: ~[Chicken],
2671-
farmer: Human
2668+
chickens: ~[Chicken],
2669+
pub farmer: Human
26722670
}
26732671
26742672
impl Farm {

branches/try/src/libarena/lib.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
#![allow(missing_doc)]
2626
#![feature(managed_boxes)]
2727

28+
#![allow(visible_private_types)] // NOTE: remove after a stage0 snap
29+
2830
extern crate collections;
2931

3032
use std::cast::{transmute, transmute_mut, transmute_mut_region};
@@ -83,9 +85,9 @@ pub struct Arena {
8385
// The head is separated out from the list as a unbenchmarked
8486
// microoptimization, to avoid needing to case on the list to
8587
// access the head.
86-
priv head: Chunk,
87-
priv copy_head: Chunk,
88-
priv chunks: RefCell<Vec<Chunk>>,
88+
head: Chunk,
89+
copy_head: Chunk,
90+
chunks: RefCell<Vec<Chunk>>,
8991
}
9092

9193
impl Arena {
@@ -333,14 +335,14 @@ fn test_arena_destructors_fail() {
333335
/// run again for these objects.
334336
pub struct TypedArena<T> {
335337
/// A pointer to the next object to be allocated.
336-
priv ptr: *T,
338+
ptr: *T,
337339

338340
/// A pointer to the end of the allocated area. When this pointer is
339341
/// reached, a new chunk is allocated.
340-
priv end: *T,
342+
end: *T,
341343

342344
/// A pointer to the first arena segment.
343-
priv first: Option<~TypedArenaChunk<T>>,
345+
first: Option<~TypedArenaChunk<T>>,
344346
}
345347

346348
struct TypedArenaChunk<T> {

0 commit comments

Comments
 (0)