Skip to content

Commit 2c5108c

Browse files
committed
---
yaml --- r: 128827 b: refs/heads/try c: bede9ec h: refs/heads/master i: 128825: 09cf34a 128823: 55a533c v: v3
1 parent d44322c commit 2c5108c

File tree

205 files changed

+1996
-5057
lines changed

Some content is hidden

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

205 files changed

+1996
-5057
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: 07d86b46a949a94223da714e35b343243e4ecce4
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a86d9ad15e339ab343a12513f9c90556f677b9ca
5-
refs/heads/try: f8e0ede92157995665c7caf4ae115354139be46d
5+
refs/heads/try: bede9ecdfe64ae59e054df455ff22b6563ac0512
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/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

branches/try/src/compiletest/runtest.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ use std::os;
3030
use std::str;
3131
use std::string::String;
3232
use std::task;
33-
use std::time::Duration;
3433
use test::MetricMap;
3534

3635
pub fn run(config: Config, testfile: String) {
@@ -401,7 +400,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
401400
.expect(format!("failed to exec `{}`", config.adb_path).as_slice());
402401
loop {
403402
//waiting 1 second for gdbserver start
404-
timer::sleep(Duration::milliseconds(1000));
403+
timer::sleep(1000);
405404
let result = task::try(proc() {
406405
tcp::TcpStream::connect("127.0.0.1", 5039).unwrap();
407406
});

branches/try/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

branches/try/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

branches/try/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

branches/try/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

branches/try/src/doc/guide.md

Lines changed: 31 additions & 27 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,6 +1796,21 @@ 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+
17991814
## Processing a Guess
18001815

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

19351950
```{notrust,ignore}
1936-
$ ./target/guessing_game
1951+
$ ./target/guessing_game
19371952
Guess the number!
19381953
The secret number is: 7
19391954
Please input your guess.
19401955
4
19411956
You guessed: 4
1942-
$ ./target/guessing_game
1957+
$ ./target/guessing_game
19431958
Guess the number!
19441959
The secret number is: 83
19451960
Please input your guess.
19461961
5
19471962
You guessed: 5
1948-
$ ./target/guessing_game
1963+
$ ./target/guessing_game
19491964
Guess the number!
19501965
The secret number is: -29
19511966
Please input your guess.
@@ -1986,7 +2001,7 @@ And trying it out:
19862001
```{notrust,ignore}
19872002
$ cargo build
19882003
Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
1989-
$ ./target/guessing_game
2004+
$ ./target/guessing_game
19902005
Guess the number!
19912006
The secret number is: 57
19922007
Please input your guess.
@@ -2022,7 +2037,7 @@ fn main() {
20222037
20232038
println!("You guessed: {}", input);
20242039
2025-
match cmp(input, secret_number) {
2040+
match cmp(input, secret_number) {
20262041
Less => println!("Too small!"),
20272042
Greater => println!("Too big!"),
20282043
Equal => { println!("You win!"); },
@@ -2106,7 +2121,7 @@ a `String` instead! That's because our `input` variable is coming from the
21062121
standard input, and you can guess anything. Try it:
21072122

21082123
```{notrust,ignore}
2109-
$ ./target/guessing_game
2124+
$ ./target/guessing_game
21102125
Guess the number!
21112126
The secret number is: 73
21122127
Please input your guess.
@@ -2257,7 +2272,7 @@ print an error message and return. Let's give this a shot:
22572272
```{notrust,ignore}
22582273
$ cargo build
22592274
Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
2260-
$ ./target/guessing_game
2275+
$ ./target/guessing_game
22612276
Guess the number!
22622277
The secret number is: 17
22632278
Please input your guess.
@@ -2323,7 +2338,7 @@ Let's try it!
23232338
```{notrust,ignore}
23242339
$ cargo build
23252340
Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
2326-
$ ./target/guessing_game
2341+
$ ./target/guessing_game
23272342
Guess the number!
23282343
The secret number is: 58
23292344
Please input your guess.
@@ -2401,7 +2416,7 @@ that `return`? If we give a non-number answer, we'll `return` and quit. Observe:
24012416
```{notrust,ignore}
24022417
$ cargo build
24032418
Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
2404-
$ ./target/guessing_game
2419+
$ ./target/guessing_game
24052420
Guess the number!
24062421
The secret number is: 59
24072422
Please input your guess.
@@ -2534,7 +2549,7 @@ Now we should be good! Let's try:
25342549
```{rust,ignore}
25352550
$ cargo build
25362551
Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
2537-
$ ./target/guessing_game
2552+
$ ./target/guessing_game
25382553
Guess the number!
25392554
The secret number is: 61
25402555
Please input your guess.
@@ -2731,16 +2746,6 @@ mod hello {
27312746

27322747
This will work:
27332748

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-
27442749
```{notrust,ignore}
27452750
$ cargo run
27462751
Compiling modules v0.1.0 (file:/home/steve/tmp/modules)
@@ -3647,14 +3652,14 @@ In order to truly understand this error, we have to learn a few new concepts:
36473652
All of our references so far have been to variables we've created on the stack.
36483653
In Rust, the simplest way to allocate heap variables is using a *box*. To
36493654
create a box, use the `box` keyword:
3650-
3655+
36513656
```{rust}
36523657
let x = box 5i;
36533658
```
36543659

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

36593664
```{rust}
36603665
{
@@ -4189,7 +4194,7 @@ the match:
41894194

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

@@ -4700,4 +4705,3 @@ fail.
47004705
# Macros
47014706

47024707
# Unsafe
4703-

0 commit comments

Comments
 (0)