Skip to content

Commit c2c6e2e

Browse files
committed
---
yaml --- r: 127953 b: refs/heads/master c: 0f40cf1 h: refs/heads/master i: 127951: b2e924e v: v3
1 parent 51e55d2 commit c2c6e2e

File tree

273 files changed

+2370
-6111
lines changed

Some content is hidden

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

273 files changed

+2370
-6111
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: ec1d34eb276f8eedf026143d18c9416dc5836d50
2+
refs/heads/master: 0f40cf1f5946dabf7652afa8ee7afb03d13af9bc
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: aa98b25c4f0c10729dff37c699904ad57b8fbda8
55
refs/heads/try: f1778314378f8951328206626b5ddf725898e0e6

trunk/src/compiletest/header.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ fn parse_exec_env(line: &str) -> Option<(String, String)> {
233233
parse_name_value_directive(line, "exec-env").map(|nv| {
234234
// nv is either FOO or FOO=BAR
235235
let mut strs: Vec<String> = nv.as_slice()
236-
.splitn(1, '=')
236+
.splitn('=', 1)
237237
.map(|s| s.to_string())
238238
.collect();
239239

trunk/src/compiletest/runtest.rs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ use header::TestProps;
1616
use header;
1717
use procsrv;
1818
use util::logv;
19-
#[cfg(target_os = "windows")]
20-
#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
19+
#[cfg(target_os = "win32")]
2120
use util;
2221

2322
use std::io::File;
@@ -31,7 +30,6 @@ use std::os;
3130
use std::str;
3231
use std::string::String;
3332
use std::task;
34-
use std::time::Duration;
3533
use test::MetricMap;
3634

3735
pub fn run(config: Config, testfile: String) {
@@ -402,7 +400,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
402400
.expect(format!("failed to exec `{}`", config.adb_path).as_slice());
403401
loop {
404402
//waiting 1 second for gdbserver start
405-
timer::sleep(Duration::milliseconds(1000));
403+
timer::sleep(1000);
406404
let result = task::try(proc() {
407405
tcp::TcpStream::connect("127.0.0.1", 5039).unwrap();
408406
});
@@ -818,8 +816,7 @@ fn check_expected_errors(expected_errors: Vec<errors::ExpectedError> ,
818816
format!("{}:{}:", testfile.display(), ee.line)
819817
}).collect::<Vec<String> >();
820818

821-
#[cfg(target_os = "windows")]
822-
#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
819+
#[cfg(target_os = "win32")]
823820
fn to_lower( s : &str ) -> String {
824821
let i = s.chars();
825822
let c : Vec<char> = i.map( |c| {
@@ -832,8 +829,7 @@ fn check_expected_errors(expected_errors: Vec<errors::ExpectedError> ,
832829
String::from_chars(c.as_slice())
833830
}
834831

835-
#[cfg(target_os = "windows")]
836-
#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
832+
#[cfg(target_os = "win32")]
837833
fn prefix_matches( line : &str, prefix : &str ) -> bool {
838834
to_lower(line).as_slice().starts_with(to_lower(prefix).as_slice())
839835
}
@@ -1250,16 +1246,14 @@ fn make_cmdline(_libpath: &str, prog: &str, args: &[String]) -> String {
12501246
format!("{} {}", prog, args.connect(" "))
12511247
}
12521248

1253-
#[cfg(target_os = "windows")]
1254-
#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
1249+
#[cfg(target_os = "win32")]
12551250
fn make_cmdline(libpath: &str, prog: &str, args: &[String]) -> String {
12561251
format!("{} {} {}", lib_path_cmd_prefix(libpath), prog, args.connect(" "))
12571252
}
12581253

12591254
// Build the LD_LIBRARY_PATH variable as it would be seen on the command line
12601255
// for diagnostic purposes
1261-
#[cfg(target_os = "windows")]
1262-
#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
1256+
#[cfg(target_os = "win32")]
12631257
fn lib_path_cmd_prefix(path: &str) -> String {
12641258
format!("{}=\"{}\"", util::lib_path_env_var(), util::make_new_path(path))
12651259
}

trunk/src/compiletest/util.rs

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

1111
use common::Config;
1212

13-
#[cfg(target_os = "windows")]
14-
#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
13+
#[cfg(target_os = "win32")]
1514
use std::os::getenv;
1615

1716
/// Conversion table from triple OS name to Rust SYSNAME
1817
static OS_TABLE: &'static [(&'static str, &'static str)] = &[
19-
("mingw32", "windows"),
20-
("win32", "windows"),
21-
("windows", "windows"),
18+
("mingw32", "win32"),
19+
("win32", "win32"),
2220
("darwin", "macos"),
2321
("android", "android"),
2422
("linux", "linux"),
@@ -35,8 +33,7 @@ pub fn get_os(triple: &str) -> &'static str {
3533
fail!("Cannot determine OS from triple");
3634
}
3735

38-
#[cfg(target_os = "windows")]
39-
#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
36+
#[cfg(target_os = "win32")]
4037
pub fn make_new_path(path: &str) -> String {
4138

4239
// Windows just uses PATH as the library search path, so we have to
@@ -49,12 +46,10 @@ pub fn make_new_path(path: &str) -> String {
4946
}
5047
}
5148

52-
#[cfg(target_os = "windows")]
53-
#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
49+
#[cfg(target_os = "win32")]
5450
pub fn lib_path_env_var() -> &'static str { "PATH" }
5551

56-
#[cfg(target_os = "windows")]
57-
#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
52+
#[cfg(target_os = "win32")]
5853
pub fn path_div() -> &'static str { ";" }
5954

6055
pub fn logv(config: &Config, s: String) {

trunk/src/doc/guide-ffi.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,9 +350,9 @@ linking to, and in the second case `bar` is the type of native library that the
350350
compiler is linking to. There are currently three known types of native
351351
libraries:
352352
353-
* Dynamic - `#[link(name = "readline")]`
354-
* Static - `#[link(name = "my_build_dependency", kind = "static")]`
355-
* Frameworks - `#[link(name = "CoreFoundation", kind = "framework")]`
353+
* Dynamic - `#[link(name = "readline")]
354+
* Static - `#[link(name = "my_build_dependency", kind = "static")]
355+
* Frameworks - `#[link(name = "CoreFoundation", kind = "framework")]
356356
357357
Note that frameworks are only available on OSX targets.
358358

trunk/src/doc/guide-runtime.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ itself, yet again implying that they are not defined in the standard library.
128128
The full complement of runtime features is defined by the [`Runtime`
129129
trait](std/rt/trait.Runtime.html) and the [`Task`
130130
struct](std/rt/task/struct.Task.html). A `Task` is constant among all runtime
131-
implementations, but each runtime has its own implementation of the
131+
implementations, but each runtime implements has its own implementation of the
132132
`Runtime` trait.
133133

134134
The local `Task` stores the runtime value inside of itself, and then ownership

trunk/src/doc/guide-testing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ per-iteration speed of.
198198

199199
For benchmarks relating to processing/generating data, one can set the
200200
`bytes` field to the number of bytes consumed/produced in each
201-
iteration; this will be used to show the throughput of the benchmark.
201+
iteration; this will used to show the throughput of the benchmark.
202202
This must be the amount used in each iteration, *not* the total
203203
amount.
204204

trunk/src/doc/guide-unsafe.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ explicitly with, respectively, `value as *const T` and `value as *mut T`).
137137

138138
Going the opposite direction, from `*const` to a reference `&`, is not
139139
safe. A `&T` is always valid, and so, at a minimum, the raw pointer
140-
`*const T` has to point to a valid instance of type `T`. Furthermore,
140+
`*const T` has to be a valid to a valid instance of type `T`. Furthermore,
141141
the resulting pointer must satisfy the aliasing and mutability laws of
142142
references. The compiler assumes these properties are true for any
143143
references, no matter how they are created, and so any conversion from

trunk/src/doc/guide.md

Lines changed: 27 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ This is not the same as this, which won't compile:
666666
```{ignore}
667667
let x = 5i;
668668
669-
let y: int = if x == 5i { 10i; } else { 15i; };
669+
let y: int = if x == 5 { 10i; } else { 15i; };
670670
```
671671

672672
Note the semicolons after the 10 and 15. Rust will give us the following error:
@@ -1360,7 +1360,7 @@ while !done {
13601360
```
13611361

13621362
`while` loops are the correct choice when you're not sure how many times
1363-
you need to loop.
1363+
you need to loop.
13641364

13651365
If you need an infinite loop, you may be tempted to write this:
13661366

@@ -1650,7 +1650,7 @@ a full line of input. Nice and easy.
16501650
.ok().expect("Failed to read line");
16511651
```
16521652

1653-
Do you remember this code?
1653+
Do you remember this code?
16541654

16551655
```
16561656
enum OptionalInt {
@@ -1796,21 +1796,6 @@ Excellent! Open up your `src/main.rs` again. We'll be writing all of
17961796
our code in this file. We'll talk about multiple-file projects later on in the
17971797
guide.
17981798

1799-
Before we move on, let me show you one more Cargo command: `run`. `cargo run`
1800-
is kind of like `cargo build`, but it also then runs the produced exectuable.
1801-
Try it out:
1802-
1803-
```{notrust,ignore}
1804-
$ cargo run
1805-
Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
1806-
Running `target/guessing_game`
1807-
Hello, world!
1808-
$
1809-
```
1810-
1811-
Great! The `run` command comes in handy when you need to rapidly iterate on a project.
1812-
Our game is just such a project, we need to quickly test each iteration before moving on to the next one.
1813-
18141799
## Processing a Guess
18151800

18161801
Let's get to it! The first thing we need to do for our guessing game is
@@ -1948,19 +1933,19 @@ $
19481933
Excellent! Try running our new program a few times:
19491934

19501935
```{notrust,ignore}
1951-
$ ./target/guessing_game
1936+
$ ./target/guessing_game
19521937
Guess the number!
19531938
The secret number is: 7
19541939
Please input your guess.
19551940
4
19561941
You guessed: 4
1957-
$ ./target/guessing_game
1942+
$ ./target/guessing_game
19581943
Guess the number!
19591944
The secret number is: 83
19601945
Please input your guess.
19611946
5
19621947
You guessed: 5
1963-
$ ./target/guessing_game
1948+
$ ./target/guessing_game
19641949
Guess the number!
19651950
The secret number is: -29
19661951
Please input your guess.
@@ -2001,7 +1986,7 @@ And trying it out:
20011986
```{notrust,ignore}
20021987
$ cargo build
20031988
Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
2004-
$ ./target/guessing_game
1989+
$ ./target/guessing_game
20051990
Guess the number!
20061991
The secret number is: 57
20071992
Please input your guess.
@@ -2037,7 +2022,7 @@ fn main() {
20372022
20382023
println!("You guessed: {}", input);
20392024
2040-
match cmp(input, secret_number) {
2025+
match cmp(input, secret_number) {
20412026
Less => println!("Too small!"),
20422027
Greater => println!("Too big!"),
20432028
Equal => { println!("You win!"); },
@@ -2121,7 +2106,7 @@ a `String` instead! That's because our `input` variable is coming from the
21212106
standard input, and you can guess anything. Try it:
21222107

21232108
```{notrust,ignore}
2124-
$ ./target/guessing_game
2109+
$ ./target/guessing_game
21252110
Guess the number!
21262111
The secret number is: 73
21272112
Please input your guess.
@@ -2272,7 +2257,7 @@ print an error message and return. Let's give this a shot:
22722257
```{notrust,ignore}
22732258
$ cargo build
22742259
Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
2275-
$ ./target/guessing_game
2260+
$ ./target/guessing_game
22762261
Guess the number!
22772262
The secret number is: 17
22782263
Please input your guess.
@@ -2338,7 +2323,7 @@ Let's try it!
23382323
```{notrust,ignore}
23392324
$ cargo build
23402325
Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
2341-
$ ./target/guessing_game
2326+
$ ./target/guessing_game
23422327
Guess the number!
23432328
The secret number is: 58
23442329
Please input your guess.
@@ -2416,7 +2401,7 @@ that `return`? If we give a non-number answer, we'll `return` and quit. Observe:
24162401
```{notrust,ignore}
24172402
$ cargo build
24182403
Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
2419-
$ ./target/guessing_game
2404+
$ ./target/guessing_game
24202405
Guess the number!
24212406
The secret number is: 59
24222407
Please input your guess.
@@ -2549,7 +2534,7 @@ Now we should be good! Let's try:
25492534
```{rust,ignore}
25502535
$ cargo build
25512536
Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
2552-
$ ./target/guessing_game
2537+
$ ./target/guessing_game
25532538
Guess the number!
25542539
The secret number is: 61
25552540
Please input your guess.
@@ -2746,6 +2731,16 @@ mod hello {
27462731

27472732
This will work:
27482733

2734+
```{notrust,ignore}
2735+
$ cargo build
2736+
Compiling modules v0.1.0 (file:/home/you/projects/modules)
2737+
$
2738+
```
2739+
2740+
Before we move on, let me show you one more Cargo command: `run`. `cargo run`
2741+
is kind of like `cargo build`, but it also then runs the produced exectuable.
2742+
Try it out:
2743+
27492744
```{notrust,ignore}
27502745
$ cargo run
27512746
Compiling modules v0.1.0 (file:/home/steve/tmp/modules)
@@ -3652,14 +3647,14 @@ In order to truly understand this error, we have to learn a few new concepts:
36523647
All of our references so far have been to variables we've created on the stack.
36533648
In Rust, the simplest way to allocate heap variables is using a *box*. To
36543649
create a box, use the `box` keyword:
3655-
3650+
36563651
```{rust}
36573652
let x = box 5i;
36583653
```
36593654

36603655
This allocates an integer `5` on the heap, and creates a binding `x` that
36613656
refers to it.. The great thing about boxed pointers is that we don't have to
3662-
manually free this allocation! If we write
3657+
manually free this allocation! If we write
36633658

36643659
```{rust}
36653660
{
@@ -4194,7 +4189,7 @@ the match:
41944189

41954190
```{rust,ignore}
41964191
let x = inverse(25.0f64);
4197-
println!("{}", x + 2.0f64); // error: binary operation `+` cannot be applied
4192+
println!("{}", x + 2.0f64); // error: binary operation `+` cannot be applied
41984193
// to type `core::result::Result<f64,collections::string::String>`
41994194
```
42004195

@@ -4705,3 +4700,4 @@ fail.
47054700
# Macros
47064701

47074702
# Unsafe
4703+

0 commit comments

Comments
 (0)