Skip to content

Commit 00ef734

Browse files
committed
---
yaml --- r: 205055 b: refs/heads/tmp c: f6119f1 h: refs/heads/master i: 205053: 04dc5a8 205051: 4a685c3 205047: 2960401 205039: 7a7411c 205023: 778c038 204991: 52f2cdb 204927: dbcecbe 204799: 0c821d1 v: v3
1 parent 124b4d0 commit 00ef734

File tree

33 files changed

+486
-1288
lines changed

33 files changed

+486
-1288
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
3232
refs/heads/beta: f0213d8ffb128a16f94af7ee985dc61484596163
3333
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3434
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
35-
refs/heads/tmp: 2a5a320babdf000bc9cf719ccd9d95d250f83a02
35+
refs/heads/tmp: f6119f18d29cefab2e7e36daab033bf40f5c0fda
3636
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3737
refs/tags/homu-tmp: f0ac7e04e647381e2bb87de1f3d0b108acb24d06
3838
refs/heads/gate: 97c84447b65164731087ea82685580cc81424412

branches/tmp/src/doc/reference.md

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,27 +31,23 @@ You may also be interested in the [grammar].
3131

3232
## Unicode productions
3333

34-
A few productions in Rust's grammar permit Unicode code points outside the
35-
ASCII range. We define these productions in terms of character properties
36-
specified in the Unicode standard, rather than in terms of ASCII-range code
37-
points. The grammar has a [Special Unicode Productions][unicodeproductions]
38-
section that lists these productions.
39-
40-
[unicodeproductions]: grammar.html#special-unicode-productions
34+
A few productions in Rust's grammar permit Unicode code points outside the ASCII
35+
range. We define these productions in terms of character properties specified
36+
in the Unicode standard, rather than in terms of ASCII-range code points. The
37+
section [Special Unicode Productions](#special-unicode-productions) lists these
38+
productions.
4139

4240
## String table productions
4341

4442
Some rules in the grammar — notably [unary
4543
operators](#unary-operator-expressions), [binary
46-
operators](#binary-operator-expressions), and [keywords][keywords] — are
44+
operators](#binary-operator-expressions), and [keywords](#keywords) — are
4745
given in a simplified form: as a listing of a table of unquoted, printable
4846
whitespace-separated strings. These cases form a subset of the rules regarding
4947
the [token](#tokens) rule, and are assumed to be the result of a
5048
lexical-analysis phase feeding the parser, driven by a DFA, operating over the
5149
disjunction of all such string table entries.
5250

53-
[keywords]: grammar.html#keywords
54-
5551
When such a string enclosed in double-quotes (`"`) occurs inside the grammar,
5652
it is an implicit reference to a single member of such a string table
5753
production. See [tokens](#tokens) for more information.
@@ -79,7 +75,7 @@ An identifier is any nonempty Unicode[^non_ascii_idents] string of the following
7975
- The first character has property `XID_start`
8076
- The remaining characters have property `XID_continue`
8177

82-
that does _not_ occur in the set of [keywords][keywords].
78+
that does _not_ occur in the set of [keywords](#keywords).
8379

8480
> **Note**: `XID_start` and `XID_continue` as character properties cover the
8581
> character ranges used to form the more familiar C and Java language-family
@@ -405,7 +401,7 @@ Symbols are a general class of printable [token](#tokens) that play structural
405401
roles in a variety of grammar productions. They are catalogued here for
406402
completeness as the set of remaining miscellaneous printable tokens that do not
407403
otherwise appear as [unary operators](#unary-operator-expressions), [binary
408-
operators](#binary-operator-expressions), or [keywords][keywords].
404+
operators](#binary-operator-expressions), or [keywords](#keywords).
409405

410406

411407
## Paths
@@ -551,7 +547,7 @@ _name_ s that occur in its body. At the "current layer", they all must repeat
551547
the same number of times, so ` ( $( $i:ident ),* ; $( $j:ident ),* ) => ( $(
552548
($i,$j) ),* )` is valid if given the argument `(a,b,c ; d,e,f)`, but not
553549
`(a,b,c ; d,e)`. The repetition walks through the choices at that layer in
554-
lockstep, so the former input transcribes to `(a,d), (b,e), (c,f)`.
550+
lockstep, so the former input transcribes to `( (a,d), (b,e), (c,f) )`.
555551

556552
Nested repetitions are allowed.
557553

@@ -615,7 +611,7 @@ module needs its own source file: [module definitions](#modules) can be nested
615611
within one file.
616612

617613
Each source file contains a sequence of zero or more `item` definitions, and
618-
may optionally begin with any number of [attributes](#items-and-attributes)
614+
may optionally begin with any number of [attributes](#Items and attributes)
619615
that apply to the containing module, most of which influence the behavior of
620616
the compiler. The anonymous crate module can have additional attributes that
621617
apply to the crate as a whole.
@@ -657,7 +653,7 @@ There are several kinds of item:
657653
* [`use` declarations](#use-declarations)
658654
* [modules](#modules)
659655
* [functions](#functions)
660-
* [type definitions](grammar.html#type-definitions)
656+
* [type aliases](#type-aliases)
661657
* [structures](#structures)
662658
* [enumerations](#enumerations)
663659
* [constant items](#constant-items)
@@ -777,7 +773,7 @@ extern crate std as ruststd; // linking to 'std' under another name
777773
A _use declaration_ creates one or more local name bindings synonymous with
778774
some other [path](#paths). Usually a `use` declaration is used to shorten the
779775
path required to refer to a module item. These declarations may appear at the
780-
top of [modules](#modules) and [blocks](grammar.html#block-expressions).
776+
top of [modules](#modules) and [blocks](#blocks).
781777

782778
> **Note**: Unlike in many languages,
783779
> `use` declarations in Rust do *not* declare linkage dependency with external crates.
@@ -1148,7 +1144,9 @@ let px: i32 = match p { Point(x, _) => x };
11481144
```
11491145

11501146
A _unit-like struct_ is a structure without any fields, defined by leaving off
1151-
the list of fields entirely. Such types will have a single value. For example:
1147+
the list of fields entirely. Such types will have a single value, just like
1148+
the [unit value `()`](#unit-and-boolean-literals) of the unit type. For
1149+
example:
11521150

11531151
```
11541152
struct Cookie;
@@ -2438,6 +2436,11 @@ comma:
24382436
(0); // zero in parentheses
24392437
```
24402438

2439+
### Unit expressions
2440+
2441+
The expression `()` denotes the _unit value_, the only value of the type with
2442+
the same name.
2443+
24412444
### Structure expressions
24422445

24432446
There are several forms of structure expressions. A _structure expression_
@@ -3278,7 +3281,7 @@ constructor or `struct` field may refer, directly or indirectly, to the
32783281
enclosing `enum` or `struct` type itself. Such recursion has restrictions:
32793282

32803283
* Recursive types must include a nominal type in the recursion
3281-
(not mere [type definitions](grammar.html#type-definitions),
3284+
(not mere [type definitions](#type-definitions),
32823285
or other structural types such as [arrays](#array,-and-slice-types) or [tuples](#tuple-types)).
32833286
* A recursive `enum` item must have at least one non-recursive constructor
32843287
(in order to give the recursion a basis case).

branches/tmp/src/doc/trpl/compiler-plugins.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ for a full example, the core of which is reproduced here:
176176

177177
```ignore
178178
declare_lint!(TEST_LINT, Warn,
179-
"Warn about items named 'lintme'");
179+
"Warn about items named 'lintme'")
180180
181181
struct Pass;
182182

branches/tmp/src/doc/trpl/method-syntax.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,12 @@ fn grow(&self) -> Circle {
127127
We just say we’re returning a `Circle`. With this method, we can grow a new
128128
circle to any arbitrary size.
129129

130-
# Associated functions
130+
# Static methods
131131

132-
You can also define associated functions that do not take a `self` parameter.
133-
Here’s a pattern that’s very common in Rust code:
132+
You can also define static methods that do not take a `self` parameter. Here’s a
133+
pattern that’s very common in Rust code:
134134

135-
```rust
135+
```
136136
struct Circle {
137137
x: f64,
138138
y: f64,

0 commit comments

Comments
 (0)