Skip to content

Commit 85b5581

Browse files
committed
---
yaml --- r: 216245 b: refs/heads/stable c: 34601af h: refs/heads/master i: 216243: 2fc02a9 v: v3
1 parent fe4324c commit 85b5581

File tree

93 files changed

+983
-1023
lines changed

Some content is hidden

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

93 files changed

+983
-1023
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ refs/heads/tmp: 378a370ff2057afeb1eae86eb6e78c476866a4a6
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: a5286998df566e736b32f6795bfc3803bdaf453d
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: 6365080c5cd27b74ec87420c351a3e7bdcff988e
32+
refs/heads/stable: 34601afd5720eb13aa8cf49a02161802900dacf4
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375

branches/stable/src/doc/grammar.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,16 +96,12 @@ 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_eol`, `non_single_quote` and
100-
`non_double_quote`.
99+
properties: `ident`, `non_null`, `non_star`, `non_eol`, `non_slash_or_star`,
100+
`non_single_quote` and `non_double_quote`.
101101

102102
### Identifiers
103103

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.
104+
The `ident` production is any nonempty Unicode string of the following form:
109105

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

123119
- `non_null` is any single Unicode character aside from `U+0000` (null)
124120
- `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` (`*`)
125123
- `non_single_quote` is `non_null` restricted to exclude `U+0027` (`'`)
126124
- `non_double_quote` is `non_null` restricted to exclude `U+0022` (`"`)
127125

branches/stable/src/doc/reference.md

Lines changed: 33 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,15 @@ 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-
## Identifiers
68+
## Special Unicode Productions
6969

70-
An identifier is any nonempty Unicode[^non_ascii_idents] string of the following form:
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`.
7173

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

7578
- The first character has property `XID_start`
7679
- The remaining characters have property `XID_continue`
@@ -81,34 +84,42 @@ that does _not_ occur in the set of [keywords](#keywords).
8184
> character ranges used to form the more familiar C and Java language-family
8285
> identifiers.
8386
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+
8498
## Comments
8599

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

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

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

102116
Non-doc comments are interpreted as a form of whitespace.
103117

104118
## Whitespace
105119

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'`)
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'`).
112123

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

260271
A _byte literal_ is a single ASCII character (in the `U+0000` to `U+007F`
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_.
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_.
266276

267277
##### Byte string literals
268278

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

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

19711981
```{.ignore}
19721982
mod m1 {
@@ -3636,4 +3646,4 @@ that have since been removed):
36363646
pattern syntax
36373647

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

branches/stable/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 `tests` submodule at the bottom of the module they
4-
test. Mark the `tests` submodule with `#[cfg(test)]` so it is only compiled when
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
55
testing.
66

7-
The `tests` module should contain:
7+
The `test` 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 tests {
20+
mod test {
2121
#[test]
2222
fn test_eq() {
2323
assert!((eq(&"".to_owned(), &"".to_owned())));

branches/stable/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 abstractions
11+
eliminating all data races. Rust also aims to achieve ‘zero-cost abstrations
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/stable/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 languages, closures are
297+
dispatch into the closure. That’s pretty neat. In many langauges, 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/stable/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 customization:
559+
`rustdoc` also contains a few other options on the command line, for further customiziation:
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/stable/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’, orAST’. This tree is a representation of the
22+
'abstract syntax tree,' or 'AST.' 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/stable/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-
Mutability is a property of either a borrow (`&mut`) or a binding (`let mut`).
132+
Mutabilty 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/stable/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)
6665
* [i16](../std/primitive.i16.html)
6766
* [i32](../std/primitive.i32.html)
6867
* [i64](../std/primitive.i64.html)
69-
* [u8](../std/primitive.u8.html)
68+
* [i8](../std/primitive.i8.html)
7069
* [u16](../std/primitive.u16.html)
7170
* [u32](../std/primitive.u32.html)
7271
* [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 has two floating point types: `f32` and `f64`. These correspond to
106+
Rust also 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/stable/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 `tests` module
222+
# The `test` module
223223

224224
There is one way in which our existing example is not idiomatic: it's
225-
missing the `tests` module. The idiomatic way of writing our example
225+
missing the test 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 tests {
234+
mod test {
235235
use super::add_two;
236236
237237
#[test]
@@ -241,7 +241,7 @@ mod tests {
241241
}
242242
```
243243

244-
There's a few changes here. The first is the introduction of a `mod tests` with
244+
There's a few changes here. The first is the introduction of a `mod test` 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 tests {
263+
mod test {
264264
use super::*;
265265
266266
#[test]
@@ -279,7 +279,7 @@ $ cargo test
279279
Running target/adder-91b3e234d4ed382a
280280

281281
running 1 test
282-
test tests::it_works ... ok
282+
test test::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 `tests` module to hold your "unit-style"
295+
The current convention is to use the `test` 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 tests::it_works ... ok
328+
test test::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 `tests` module isn't needed
349+
That's all there is to the `tests` directory. The `test` 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 tests {
385+
mod test {
386386
use super::*;
387387
388388
#[test]
@@ -405,7 +405,7 @@ $ cargo test
405405
Running target/adder-91b3e234d4ed382a
406406

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

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

branches/stable/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 optimizations from occurring.
158+
inlining and related optimisations from occurring.
159159

160160
### Why pointers?
161161

branches/stable/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 error
187+
# result.unwrap(); // ignore the erorr
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 error
206+
# result.unwrap(); // ignore the erorr
207207
```
208208

209209
This will compile without error.

branches/stable/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-
Virtually every non-'Hello World’ Rust program uses *variable bindings*. They
3+
Vitually every non-Hello World’ Rust program uses *variable bindings*. They
44
look like this:
55

66
```rust

0 commit comments

Comments
 (0)