Skip to content

Commit 0dd1388

Browse files
committed
---
yaml --- r: 209943 b: refs/heads/try c: d372434 h: refs/heads/master i: 209941: 162fb13 209939: f74734e 209935: 0955f35 v: v3
1 parent c5c986d commit 0dd1388

File tree

92 files changed

+1035
-967
lines changed

Some content is hidden

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

92 files changed

+1035
-967
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: 3e561f05c00cd180ec02db4ccab2840a4aba93d2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: ba0e1cd8147d452c356aacb29fb87568ca26f111
5-
refs/heads/try: 34601afd5720eb13aa8cf49a02161802900dacf4
5+
refs/heads/try: d3724342a3ef8eff3473de988f80bc088dc2668d
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/src/doc/grammar.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,16 @@ explicit codepoint lists. [^inputformat]
9696
## Special Unicode Productions
9797

9898
The following productions in the Rust grammar are defined in terms of Unicode
99-
properties: `ident`, `non_null`, `non_star`, `non_eol`, `non_slash_or_star`,
100-
`non_single_quote` and `non_double_quote`.
99+
properties: `ident`, `non_null`, `non_eol`, `non_single_quote` and
100+
`non_double_quote`.
101101

102102
### Identifiers
103103

104-
The `ident` production is any nonempty Unicode string of the following form:
104+
The `ident` production is any nonempty Unicode[^non_ascii_idents] string of
105+
the following form:
106+
107+
[^non_ascii_idents]: Non-ASCII characters in identifiers are currently feature
108+
gated. This is expected to improve soon.
105109

106110
- The first character has property `XID_start`
107111
- The remaining characters have property `XID_continue`
@@ -118,8 +122,6 @@ Some productions are defined by exclusion of particular Unicode characters:
118122

119123
- `non_null` is any single Unicode character aside from `U+0000` (null)
120124
- `non_eol` is `non_null` restricted to exclude `U+000A` (`'\n'`)
121-
- `non_star` is `non_null` restricted to exclude `U+002A` (`*`)
122-
- `non_slash_or_star` is `non_null` restricted to exclude `U+002F` (`/`) and `U+002A` (`*`)
123125
- `non_single_quote` is `non_null` restricted to exclude `U+0027` (`'`)
124126
- `non_double_quote` is `non_null` restricted to exclude `U+0022` (`"`)
125127

branches/try/src/doc/reference.md

Lines changed: 23 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,12 @@ explicit code point lists. [^inputformat]
6565
provided to the grammar verifier, restricted to ASCII range, when verifying the
6666
grammar in this document.
6767

68-
## Special Unicode Productions
68+
## Identifiers
6969

70-
The following productions in the Rust grammar are defined in terms of Unicode
71-
properties: `ident`, `non_null`, `non_star`, `non_eol`, `non_slash_or_star`,
72-
`non_single_quote` and `non_double_quote`.
70+
An identifier is any nonempty Unicode[^non_ascii_idents] string of the following form:
7371

74-
### Identifiers
75-
76-
The `ident` production is any nonempty Unicode string of the following form:
72+
[^non_ascii_idents]: Non-ASCII characters in identifiers are currently feature
73+
gated. This is expected to improve soon.
7774

7875
- The first character has property `XID_start`
7976
- The remaining characters have property `XID_continue`
@@ -84,42 +81,34 @@ that does _not_ occur in the set of [keywords](#keywords).
8481
> character ranges used to form the more familiar C and Java language-family
8582
> identifiers.
8683
87-
### Delimiter-restricted productions
88-
89-
Some productions are defined by exclusion of particular Unicode characters:
90-
91-
- `non_null` is any single Unicode character aside from `U+0000` (null)
92-
- `non_eol` is `non_null` restricted to exclude `U+000A` (`'\n'`)
93-
- `non_star` is `non_null` restricted to exclude `U+002A` (`*`)
94-
- `non_slash_or_star` is `non_null` restricted to exclude `U+002F` (`/`) and `U+002A` (`*`)
95-
- `non_single_quote` is `non_null` restricted to exclude `U+0027` (`'`)
96-
- `non_double_quote` is `non_null` restricted to exclude `U+0022` (`"`)
97-
9884
## Comments
9985

100-
Comments in Rust code follow the general C++ style of line and block-comment
101-
forms. Nested block comments are supported.
86+
Comments in Rust code follow the general C++ style of line (`//`) and
87+
block-comment (`/* ... */`) forms. Nested block comments are supported.
10288

10389
Line comments beginning with exactly _three_ slashes (`///`), and block
10490
comments beginning with exactly one repeated asterisk in the block-open
10591
sequence (`/**`), are interpreted as a special syntax for `doc`
10692
[attributes](#attributes). That is, they are equivalent to writing
107-
`#[doc="..."]` around the body of the comment (this includes the comment
108-
characters themselves, i.e. `/// Foo` turns into `#[doc="/// Foo"]`).
93+
`#[doc="..."]` around the body of the comment, i.e., `/// Foo` turns into
94+
`#[doc="Foo"]`.
10995

11096
Line comments beginning with `//!` and block comments beginning with `/*!` are
11197
doc comments that apply to the parent of the comment, rather than the item
11298
that follows. That is, they are equivalent to writing `#![doc="..."]` around
113-
the body of the comment. `//!` comments are usually used to display
114-
information on the crate index page.
99+
the body of the comment. `//!` comments are usually used to document
100+
modules that occupy a source file.
115101

116102
Non-doc comments are interpreted as a form of whitespace.
117103

118104
## Whitespace
119105

120-
The `whitespace_char` production is any nonempty Unicode string consisting of
121-
any of the following Unicode characters: `U+0020` (space, `' '`), `U+0009`
122-
(tab, `'\t'`), `U+000A` (LF, `'\n'`), `U+000D` (CR, `'\r'`).
106+
Whitespace is any non-empty string containing any the following characters:
107+
108+
- `U+0020` (space, `' '`)
109+
- `U+0009` (tab, `'\t'`)
110+
- `U+000A` (LF, `'\n'`)
111+
- `U+000D` (CR, `'\r'`)
123112

124113
Rust is a "free-form" language, meaning that all forms of whitespace serve only
125114
to separate _tokens_ in the grammar, and have no semantic significance.
@@ -269,10 +258,11 @@ r##"foo #"# bar"##; // foo #"# bar
269258
##### Byte literals
270259

271260
A _byte literal_ is a single ASCII character (in the `U+0000` to `U+007F`
272-
range) enclosed within two `U+0027` (single-quote) characters, with the
273-
exception of `U+0027` itself, which must be _escaped_ by a preceding U+005C
274-
character (`\`), or a single _escape_. It is equivalent to a `u8` unsigned
275-
8-bit integer _number literal_.
261+
range) or a single _escape_ preceded by the characters `U+0062` (`b`) and
262+
`U+0027` (single-quote), and followed by the character `U+0027`. If the character
263+
`U+0027` is present within the literal, it must be _escaped_ by a preceding
264+
`U+005C` (`\`) character. It is equivalent to a `u8` unsigned 8-bit integer
265+
_number literal_.
276266

277267
##### Byte string literals
278268

@@ -1976,7 +1966,7 @@ For any lint check `C`:
19761966

19771967
The lint checks supported by the compiler can be found via `rustc -W help`,
19781968
along with their default settings. [Compiler
1979-
plugins](book/plugins.html#lint-plugins) can provide additional lint checks.
1969+
plugins](book/compiler-plugins.html#lint-plugins) can provide additional lint checks.
19801970

19811971
```{.ignore}
19821972
mod m1 {
@@ -3646,4 +3636,4 @@ that have since been removed):
36463636
pattern syntax
36473637

36483638
[ffi]: book/ffi.html
3649-
[plugin]: book/plugins.html
3639+
[plugin]: book/compiler-plugins.html

branches/try/src/doc/style/testing/unit.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
% Unit testing
22

3-
Unit tests should live in a `test` submodule at the bottom of the module they
4-
test. Mark the `test` submodule with `#[cfg(test)]` so it is only compiled when
3+
Unit tests should live in a `tests` submodule at the bottom of the module they
4+
test. Mark the `tests` submodule with `#[cfg(test)]` so it is only compiled when
55
testing.
66

7-
The `test` module should contain:
7+
The `tests` module should contain:
88

99
* Imports needed only for testing.
1010
* Functions marked with `#[test]` striving for full coverage of the parent module's
@@ -17,7 +17,7 @@ For example:
1717
// Excerpt from std::str
1818

1919
#[cfg(test)]
20-
mod test {
20+
mod tests {
2121
#[test]
2222
fn test_eq() {
2323
assert!((eq(&"".to_owned(), &"".to_owned())));

branches/try/src/doc/trpl/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ good at: embedding in other languages, programs with specific space and time
88
requirements, and writing low-level code, like device drivers and operating
99
systems. It improves on current languages targeting this space by having a
1010
number of compile-time safety checks that produce no runtime overhead, while
11-
eliminating all data races. Rust also aims to achieve ‘zero-cost abstrations
11+
eliminating all data races. Rust also aims to achieve ‘zero-cost abstractions
1212
even though some of these abstractions feel like those of a high-level
1313
language. Even then, Rust still allows precise control like a low-level
1414
language would.

branches/try/src/doc/trpl/closures.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ is `Fn(i32) -> i32`.
294294

295295
There’s one other key point here: because we’re bounding a generic with a
296296
trait, this will get monomorphized, and therefore, we’ll be doing static
297-
dispatch into the closure. That’s pretty neat. In many langauges, closures are
297+
dispatch into the closure. That’s pretty neat. In many languages, closures are
298298
inherently heap allocated, and will always involve dynamic dispatch. In Rust,
299299
we can stack allocate our closure environment, and statically dispatch the
300300
call. This happens quite often with iterators and their adapters, which often

branches/try/src/doc/trpl/documentation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ This sets a few different options, with a logo, favicon, and a root URL.
556556

557557
## Generation options
558558

559-
`rustdoc` also contains a few other options on the command line, for further customiziation:
559+
`rustdoc` also contains a few other options on the command line, for further customization:
560560

561561
- `--html-in-header FILE`: includes the contents of FILE at the end of the
562562
`<head>...</head>` section.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
% Getting Started
22

33
This first section of the book will get you going with Rust and its tooling.
4-
First, we’ll install Rust. Then: the classic ‘Hello World’ program. Finally,
4+
First, we’ll install Rust. Then, the classic ‘Hello World’ program. Finally,
55
we’ll talk about Cargo, Rust’s build system and package manager.

branches/try/src/doc/trpl/glossary.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ In the example above `x` and `y` have arity 2. `z` has arity 3.
1919

2020
When a compiler is compiling your program, it does a number of different
2121
things. One of the things that it does is turn the text of your program into an
22-
'abstract syntax tree,' or 'AST.' This tree is a representation of the
22+
abstract syntax tree’, orAST’. This tree is a representation of the
2323
structure of your program. For example, `2 + 3` can be turned into a tree:
2424

2525
```text

branches/try/src/doc/trpl/mutability.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ about it first.
129129

130130
## Field-level mutability
131131

132-
Mutabilty is a property of either a borrow (`&mut`) or a binding (`let mut`).
132+
Mutability is a property of either a borrow (`&mut`) or a binding (`let mut`).
133133
This means that, for example, you cannot have a [`struct`][struct] with
134134
some fields mutable and some immutable:
135135

branches/try/src/doc/trpl/primitive-types.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,14 @@ let y = 1.0; // y has type f64
6262
Here’s a list of the different numeric types, with links to their documentation
6363
in the standard library:
6464

65+
* [i8](../std/primitive.i8.html)
6566
* [i16](../std/primitive.i16.html)
6667
* [i32](../std/primitive.i32.html)
6768
* [i64](../std/primitive.i64.html)
68-
* [i8](../std/primitive.i8.html)
69+
* [u8](../std/primitive.u8.html)
6970
* [u16](../std/primitive.u16.html)
7071
* [u32](../std/primitive.u32.html)
7172
* [u64](../std/primitive.u64.html)
72-
* [u8](../std/primitive.u8.html)
7373
* [isize](../std/primitive.isize.html)
7474
* [usize](../std/primitive.usize.html)
7575
* [f32](../std/primitive.f32.html)
@@ -82,12 +82,12 @@ Let’s go over them by category:
8282
Integer types come in two varieties: signed and unsigned. To understand the
8383
difference, let’s consider a number with four bits of size. A signed, four-bit
8484
number would let you store numbers from `-8` to `+7`. Signed numbers use
85-
two’s compliment representation. An unsigned four bit number, since it does
85+
two’s compliment representation. An unsigned four bit number, since it does
8686
not need to store negatives, can store values from `0` to `+15`.
8787

8888
Unsigned types use a `u` for their category, and signed types use `i`. The `i`
8989
is for ‘integer’. So `u8` is an eight-bit unsigned number, and `i8` is an
90-
eight-bit signed number.
90+
eight-bit signed number.
9191

9292
## Fixed size types
9393

@@ -103,7 +103,7 @@ and unsigned varieties. This makes for two types: `isize` and `usize`.
103103

104104
## Floating-point types
105105

106-
Rust also two floating point types: `f32` and `f64`. These correspond to
106+
Rust also has two floating point types: `f32` and `f64`. These correspond to
107107
IEEE-754 single and double precision numbers.
108108

109109
# Arrays
@@ -241,8 +241,8 @@ println!("x is {}", x);
241241
Remember [before][let] when I said the left-hand side of a `let` statement was more
242242
powerful than just assigning a binding? Here we are. We can put a pattern on
243243
the left-hand side of the `let`, and if it matches up to the right-hand side,
244-
we can assign multiple bindings at once. In this case, `let` "destructures,"
245-
or "breaks up," the tuple, and assigns the bits to three bindings.
244+
we can assign multiple bindings at once. In this case, `let` destructures
245+
or breaks up the tuple, and assigns the bits to three bindings.
246246

247247
[let]: variable-bindings.html
248248

branches/try/src/doc/trpl/testing.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,10 @@ fn it_works() {
219219
This is a very common use of `assert_eq!`: call some function with
220220
some known arguments and compare it to the expected output.
221221

222-
# The `test` module
222+
# The `tests` module
223223

224224
There is one way in which our existing example is not idiomatic: it's
225-
missing the test module. The idiomatic way of writing our example
225+
missing the `tests` module. The idiomatic way of writing our example
226226
looks like this:
227227

228228
```{rust,ignore}
@@ -231,7 +231,7 @@ pub fn add_two(a: i32) -> i32 {
231231
}
232232
233233
#[cfg(test)]
234-
mod test {
234+
mod tests {
235235
use super::add_two;
236236
237237
#[test]
@@ -241,7 +241,7 @@ mod test {
241241
}
242242
```
243243

244-
There's a few changes here. The first is the introduction of a `mod test` with
244+
There's a few changes here. The first is the introduction of a `mod tests` with
245245
a `cfg` attribute. The module allows us to group all of our tests together, and
246246
to also define helper functions if needed, that don't become a part of the rest
247247
of our crate. The `cfg` attribute only compiles our test code if we're
@@ -260,7 +260,7 @@ pub fn add_two(a: i32) -> i32 {
260260
}
261261
262262
#[cfg(test)]
263-
mod test {
263+
mod tests {
264264
use super::*;
265265
266266
#[test]
@@ -279,7 +279,7 @@ $ cargo test
279279
Running target/adder-91b3e234d4ed382a
280280

281281
running 1 test
282-
test test::it_works ... ok
282+
test tests::it_works ... ok
283283

284284
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
285285

@@ -292,7 +292,7 @@ test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
292292

293293
It works!
294294

295-
The current convention is to use the `test` module to hold your "unit-style"
295+
The current convention is to use the `tests` module to hold your "unit-style"
296296
tests. Anything that just tests one small bit of functionality makes sense to
297297
go here. But what about "integration-style" tests instead? For that, we have
298298
the `tests` directory
@@ -325,7 +325,7 @@ $ cargo test
325325
Running target/adder-91b3e234d4ed382a
326326

327327
running 1 test
328-
test test::it_works ... ok
328+
test tests::it_works ... ok
329329

330330
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
331331

@@ -346,7 +346,7 @@ test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
346346
Now we have three sections: our previous test is also run, as well as our new
347347
one.
348348

349-
That's all there is to the `tests` directory. The `test` module isn't needed
349+
That's all there is to the `tests` directory. The `tests` module isn't needed
350350
here, since the whole thing is focused on tests.
351351

352352
Let's finally check out that third section: documentation tests.
@@ -382,7 +382,7 @@ pub fn add_two(a: i32) -> i32 {
382382
}
383383
384384
#[cfg(test)]
385-
mod test {
385+
mod tests {
386386
use super::*;
387387
388388
#[test]
@@ -405,7 +405,7 @@ $ cargo test
405405
Running target/adder-91b3e234d4ed382a
406406

407407
running 1 test
408-
test test::it_works ... ok
408+
test tests::it_works ... ok
409409

410410
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
411411

branches/try/src/doc/trpl/trait-objects.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ A function that takes a trait object is not specialized to each of the types
155155
that implements `Foo`: only one copy is generated, often (but not always)
156156
resulting in less code bloat. However, this comes at the cost of requiring
157157
slower virtual function calls, and effectively inhibiting any chance of
158-
inlining and related optimisations from occurring.
158+
inlining and related optimizations from occurring.
159159

160160
### Why pointers?
161161

branches/try/src/doc/trpl/traits.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ won’t have its methods:
184184
```rust,ignore
185185
let mut f = std::fs::File::open("foo.txt").ok().expect("Couldn’t open foo.txt");
186186
let result = f.write("whatever".as_bytes());
187-
# result.unwrap(); // ignore the erorr
187+
# result.unwrap(); // ignore the error
188188
```
189189

190190
Here’s the error:
@@ -203,7 +203,7 @@ use std::io::Write;
203203
204204
let mut f = std::fs::File::open("foo.txt").ok().expect("Couldn’t open foo.txt");
205205
let result = f.write("whatever".as_bytes());
206-
# result.unwrap(); // ignore the erorr
206+
# result.unwrap(); // ignore the error
207207
```
208208

209209
This will compile without error.

branches/try/src/doc/trpl/variable-bindings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
% Variable Bindings
22

3-
Vitually every non-Hello World’ Rust program uses *variable bindings*. They
3+
Virtually every non-'Hello World’ Rust program uses *variable bindings*. They
44
look like this:
55

66
```rust

0 commit comments

Comments
 (0)