Skip to content

Commit c103e46

Browse files
committed
---
yaml --- r: 128815 b: refs/heads/try c: 5eb4e1a h: refs/heads/master i: 128813: cabc385 128811: b55dead 128807: 5b66e82 128799: ae3d470 v: v3
1 parent 1869225 commit c103e46

File tree

174 files changed

+769
-3270
lines changed

Some content is hidden

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

174 files changed

+769
-3270
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: 32098bbb0dabf45735648b4a6cae5291abbdb9c8
5+
refs/heads/try: 5eb4e1a6590908a2b58dc08b815ecb32868217f2
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ documentation.
3232

3333
To build from the [tarball] do:
3434

35-
$ curl -O https://static.rust-lang.org/dist/rust-nightly.tar.gz
35+
$ curl -O http://static.rust-lang.org/dist/rust-nightly.tar.gz
3636
$ tar -xzf rust-nightly.tar.gz
3737
$ cd rust-nightly
3838

@@ -75,7 +75,7 @@ To easily build on windows we can use [MSYS2](http://sourceforge.net/projects/ms
7575
$ make && make install
7676

7777
[repo]: https://github.com/rust-lang/rust
78-
[tarball]: https://static.rust-lang.org/dist/rust-nightly.tar.gz
78+
[tarball]: http://static.rust-lang.org/dist/rust-nightly.tar.gz
7979
[tutorial]: http://doc.rust-lang.org/tutorial.html
8080

8181
## Notes

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: 10 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,21 @@ Linux or a Mac, all you need to do is this (note that you don't need to type
3232
in the `$`s, they just indicate the start of each command):
3333

3434
```{ignore}
35-
$ curl -s https://static.rust-lang.org/rustup.sh | sudo sh
35+
$ curl -s http://www.rust-lang.org/rustup.sh | sudo sh
3636
```
3737

3838
(If you're concerned about `curl | sudo sh`, please keep reading. Disclaimer
3939
below.)
4040

4141
If you're on Windows, please [download this .exe and run
42-
it](https://static.rust-lang.org/dist/rust-nightly-install.exe).
42+
it](http://static.rust-lang.org/dist/rust-nightly-install.exe).
4343

4444
If you decide you don't want Rust anymore, we'll be a bit sad, but that's okay.
4545
Not every programming language is great for everyone. Just pass an argument to
4646
the script:
4747

4848
```{ignore}
49-
$ curl -s https://static.rust-lang.org/rustup.sh | sudo sh -s -- --uninstall
49+
$ curl -s http://www.rust-lang.org/rustup.sh | sudo sh -s -- --uninstall
5050
```
5151

5252
If you used the Windows installer, just re-run the `.exe` and it will give you
@@ -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:
@@ -1341,7 +1341,7 @@ computer science: naming things, cache invalidation, and off-by-one errors."
13411341
The joke, of course, being that the setup says "two hard problems" but then
13421342
lists three things. This happens quite a bit with "C style" `for` loops.
13431343

1344-
We'll talk more about `for` when we cover **iterator**s, later in the Guide.
1344+
We'll talk more about `for` when we cover **vector**s, later in the Guide.
13451345

13461346
## `while`
13471347

@@ -1427,6 +1427,11 @@ for x in range(0i, 10i) {
14271427

14281428
Both `continue` and `break` are valid in both kinds of loops.
14291429

1430+
We have now learned all of the most basic Rust concepts. We're ready to start
1431+
building our guessing game, but we need to know how to do one last thing first:
1432+
get input from the keyboard. You can't have a guessing game without the ability
1433+
to guess!
1434+
14301435
# Strings
14311436

14321437
Strings are an important concept for any programmer to master. Rust's string
@@ -1507,76 +1512,6 @@ low-level details matter, they really matter. Just remember that `String`s
15071512
allocate memory and control their data, while `&str`s are a reference to
15081513
another string, and you'll be all set.
15091514

1510-
# Vectors
1511-
1512-
Like many programming languages, Rust has a list type for when you want a list
1513-
of things. But similar to strings, Rust has different types to represent this
1514-
idea: `Vec<T>` (a 'vector'), `[T, .. N]` (an 'array'), and `&[T]` (a 'slice').
1515-
Whew!
1516-
1517-
Vectors are similar to `String`s: they have a dynamic length, and they
1518-
allocate enough memory to fit. You can create a vector with the `vec!` macro:
1519-
1520-
```{rust}
1521-
let nums = vec![1i, 2i, 3i];
1522-
```
1523-
1524-
Notice that unlike the `println!` macro we've used in the past, we use square
1525-
brackets (`[]`) with `vec!`. Rust allows you to use either in either situation,
1526-
this is just convention.
1527-
1528-
You can create an array with just square brackets:
1529-
1530-
```{rust}
1531-
let nums = [1i, 2i, 3i];
1532-
```
1533-
1534-
So what's the difference? An array has a fixed size, so you can't add or
1535-
subtract elements:
1536-
1537-
```{rust,ignore}
1538-
let mut nums = vec![1i, 2i, 3i];
1539-
nums.push(4i); // works
1540-
1541-
let mut nums = [1i, 2i, 3i];
1542-
nums.push(4i); // error: type `[int, .. 3]` does not implement any method
1543-
// in scope named `push`
1544-
```
1545-
1546-
The `push()` method lets you append a value to the end of the vector. But
1547-
since arrays have fixed sizes, adding an element doesn't make any sense.
1548-
You can see how it has the exact type in the error message: `[int, .. 3]`.
1549-
An array of `int`s, with length 3.
1550-
1551-
Similar to `&str`, a slice is a reference to another array. We can get a
1552-
slice from a vector by using the `as_slice()` method:
1553-
1554-
```{rust}
1555-
let vec = vec![1i, 2i, 3i];
1556-
let slice = vec.as_slice();
1557-
```
1558-
1559-
All three types implement an `iter()` method, which returns an iterator. We'll
1560-
talk more about the details of iterators later, but for now, the `iter()` method
1561-
allows you to write a `for` loop that prints out the contents of a vector, array,
1562-
or slice:
1563-
1564-
```{rust}
1565-
let vec = vec![1i, 2i, 3i];
1566-
1567-
for i in vec.iter() {
1568-
println!("{}", i);
1569-
}
1570-
```
1571-
1572-
This code will print each number in order, on its own line.
1573-
1574-
There's a whole lot more to vectors, but that's enough to get started. We have
1575-
now learned all of the most basic Rust concepts. We're ready to start building
1576-
our guessing game, but we need to know how to do one last thing first: get
1577-
input from the keyboard. You can't have a guessing game without the ability to
1578-
guess!
1579-
15801515
# Standard Input
15811516

15821517
Getting input from the keyboard is pretty easy, but uses some things

0 commit comments

Comments
 (0)