Skip to content

Commit 84d8fd2

Browse files
committed
---
yaml --- r: 179939 b: refs/heads/snap-stage3 c: 3513c97 h: refs/heads/master i: 179937: 3c6d82d 179935: 6a7a598 v: v3
1 parent d2ba2b1 commit 84d8fd2

Some content is hidden

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

86 files changed

+573
-977
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: 5936278ed6bef736f6eb8c0dd4d650fd8e10461b
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: ba7b79008b5166b2b1cf043b4533917103d3e06e
4+
refs/heads/snap-stage3: 3513c97302b72b6dd51136ce1e259ca0e67458f3
55
refs/heads/try: ccf8fedf1cffcb8f6f3581d53d220039e192fe77
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/src/doc/grammar.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ token : simple_token | ident | literal | symbol | whitespace token ;
157157

158158
| | | | | |
159159
|----------|----------|----------|----------|--------|
160-
| abstract | alignof | as | become | box |
160+
| abstract | alignof | as | be | box |
161161
| break | const | continue | crate | do |
162162
| else | enum | extern | false | final |
163163
| fn | for | if | impl | in |

branches/snap-stage3/src/doc/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ tools we have are really nice.
5959
[Cargo](http://crates.io) is Rust's package manager, and its website contains
6060
lots of good documentation.
6161

62-
[`rustdoc`](book/documentation.html) is used to generate documentation for Rust code.
62+
[The `rustdoc` manual](rustdoc.html) contains information about Rust's
63+
documentation tool.
6364

6465
# FAQs
6566

branches/snap-stage3/src/doc/reference.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ grammar as double-quoted strings. Other tokens have exact rules given.
189189

190190
| | | | | |
191191
|----------|----------|----------|----------|---------|
192-
| abstract | alignof | as | become | box |
192+
| abstract | alignof | as | be | box |
193193
| break | const | continue | crate | do |
194194
| else | enum | extern | false | final |
195195
| fn | for | if | impl | in |
@@ -381,13 +381,11 @@ character (`\`), or a single _escape_. It is equivalent to a `u8` unsigned
381381

382382
##### Byte string literals
383383

384-
A non-raw _byte string literal_ is a sequence of ASCII characters and _escapes_,
385-
preceded by the characters `U+0062` (`b`) and `U+0022` (double-quote), and
386-
followed by the character `U+0022`. If the character `U+0022` is present within
387-
the literal, it must be _escaped_ by a preceding `U+005C` (`\`) character.
388-
Alternatively, a byte string literal can be a _raw byte string literal_, defined
389-
below. A byte string literal is equivalent to a `&'static [u8]` borrowed array
390-
of unsigned 8-bit integers.
384+
A _byte string literal_ is a sequence of ASCII characters and _escapes_
385+
enclosed within two `U+0022` (double-quote) characters, with the exception of
386+
`U+0022` itself, which must be _escaped_ by a preceding `U+005C` character
387+
(`\`), or a _raw byte string literal_. It is equivalent to a `&'static [u8]`
388+
borrowed array of unsigned 8-bit integers.
391389

392390
Some additional _escapes_ are available in either byte or non-raw byte string
393391
literals. An escape starts with a `U+005C` (`\`) and continues with one of the
@@ -1255,7 +1253,9 @@ fn my_err(s: &str) -> ! {
12551253
We call such functions "diverging" because they never return a value to the
12561254
caller. Every control path in a diverging function must end with a `panic!()` or
12571255
a call to another diverging function on every control path. The `!` annotation
1258-
does *not* denote a type.
1256+
does *not* denote a type. Rather, the result type of a diverging function is a
1257+
special type called ⊥ ("bottom") that unifies with any type. Rust has no
1258+
syntax for ⊥.
12591259

12601260
It might be necessary to declare a diverging function because as mentioned
12611261
previously, the typechecker checks that every control path in a function ends
@@ -2354,8 +2354,8 @@ Supported traits for `derive` are:
23542354
* `FromPrimitive`, to create an instance from a numeric primitive.
23552355
* `Hash`, to iterate over the bytes in a data type.
23562356
* `Rand`, to create a random instance of a data type.
2357-
* `Debug`, to format a value using the `{:?}` formatter.
2358-
* `Copy`, for "Plain Old Data" types which can be copied by simply moving bits.
2357+
* `Show`, to format a value using the `{}` formatter.
2358+
* `Zero`, to create a zero instance of a numeric data type.
23592359

23602360
### Compiler Features
23612361

branches/snap-stage3/src/doc/rust.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
body {
5959
margin: 0 auto;
6060
padding: 0 15px;
61-
font-family: "Source Serif Pro", Georgia, Times, "Times New Roman", serif;
61+
font-family: "Source Serif Pro", "Helvetica Neue", Helvetica, Arial, sans-serif;
6262
font-size: 18px;
6363
color: #333;
6464
line-height: 1.428571429;

branches/snap-stage3/src/doc/trpl/SUMMARY.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
* [Iterators](iterators.md)
2828
* [Generics](generics.md)
2929
* [Traits](traits.md)
30-
* [Static and Dynamic Dispatch](static-and-dynamic-dispatch.md)
3130
* [Concurrency](concurrency.md)
3231
* [Error Handling](error-handling.md)
3332
* [Documentation](documentation.md)

branches/snap-stage3/src/doc/trpl/closures.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ arguments, really powerful things are possible.
99
Let's make a closure:
1010

1111
```{rust}
12-
let add_one = |x| { 1 + x };
12+
let add_one = |&: x| { 1 + x };
1313
1414
println!("The sum of 5 plus 1 is {}.", add_one(5));
1515
```
@@ -21,8 +21,8 @@ binding name and two parentheses, just like we would for a named function.
2121
Let's compare syntax. The two are pretty close:
2222

2323
```{rust}
24-
let add_one = |x: i32| -> i32 { 1 + x };
25-
fn add_one (x: i32) -> i32 { 1 + x }
24+
let add_one = |&: x: i32| -> i32 { 1 + x };
25+
fn add_one (x: i32) -> i32 { 1 + x }
2626
```
2727

2828
As you may have noticed, closures infer their argument and return types, so you
@@ -37,7 +37,7 @@ this:
3737
fn main() {
3838
let x: i32 = 5;
3939
40-
let printer = || { println!("x is: {}", x); };
40+
let printer = |&:| { println!("x is: {}", x); };
4141
4242
printer(); // prints "x is: 5"
4343
}
@@ -53,7 +53,7 @@ defined. The closure borrows any variables it uses, so this will error:
5353
fn main() {
5454
let mut x: i32 = 5;
5555
56-
let printer = || { println!("x is: {}", x); };
56+
let printer = |&:| { println!("x is: {}", x); };
5757
5858
x = 6; // error: cannot assign to `x` because it is borrowed
5959
}
@@ -80,7 +80,7 @@ fn twice<F: Fn(i32) -> i32>(x: i32, f: F) -> i32 {
8080
}
8181
8282
fn main() {
83-
let square = |x: i32| { x * x };
83+
let square = |&: x: i32| { x * x };
8484
8585
twice(5, square); // evaluates to 50
8686
}
@@ -89,15 +89,15 @@ fn main() {
8989
Let's break the example down, starting with `main`:
9090

9191
```{rust}
92-
let square = |x: i32| { x * x };
92+
let square = |&: x: i32| { x * x };
9393
```
9494

9595
We've seen this before. We make a closure that takes an integer, and returns
9696
its square.
9797

9898
```{rust}
9999
# fn twice<F: Fn(i32) -> i32>(x: i32, f: F) -> i32 { f(x) + f(x) }
100-
# let square = |x: i32| { x * x };
100+
# let square = |&: x: i32| { x * x };
101101
twice(5, square); // evaluates to 50
102102
```
103103

@@ -184,8 +184,8 @@ fn compose<F, G>(x: i32, f: F, g: G) -> i32
184184
185185
fn main() {
186186
compose(5,
187-
|n: i32| { n + 42 },
188-
|n: i32| { n * 2 }); // evaluates to 94
187+
|&: n: i32| { n + 42 },
188+
|&: n: i32| { n * 2 }); // evaluates to 94
189189
}
190190
```
191191

branches/snap-stage3/src/doc/trpl/compound-data-types.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -72,20 +72,6 @@ if x == y {
7272

7373
This will print `no`, because some of the values aren't equal.
7474

75-
Note that the order of the values is considered when checking for equality,
76-
so the following example will also print `no`.
77-
78-
```rust
79-
let x = (1, 2, 3);
80-
let y = (2, 1, 3);
81-
82-
if x == y {
83-
println!("yes");
84-
} else {
85-
println!("no");
86-
}
87-
```
88-
8975
One other use of tuples is to return multiple values from a function:
9076

9177
```rust

0 commit comments

Comments
 (0)