Skip to content

Commit 3e57a06

Browse files
committed
Adjust some rule names for clarity
This adjusts some rule names to be more explicit about what they are for.
1 parent efe16bf commit 3e57a06

11 files changed

+26
-24
lines changed

Diff for: src/expressions/await-expr.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ future is ready to produce a value.
1414
r[expr.await.construct]
1515
The syntax for an await expression is an expression with a type that implements the [`IntoFuture`] trait, called the *future operand*, then the token `.`, and then the `await` keyword.
1616

17-
r[expr.await.constraints]
17+
r[expr.await.allowed-positions]
1818
Await expressions are legal only within an [async context], like an [`async fn`], [`async` closure], or [`async` block].
1919

2020
r[expr.await.effects]

Diff for: src/expressions/field-expr.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ When the operand is [mutable], the field expression is also mutable.
1515
r[expr.field.form]
1616
The syntax for a field expression is an expression, called the *container operand*, then a `.`, and finally an [identifier].
1717

18-
r[expr.field.constraint]
18+
r[expr.field.not-method-call]
1919
Field expressions cannot be followed by a parenthetical comma-separated list of expressions, as that is instead parsed as a [method call expression].
2020
That is, they cannot be the function operand of a [call expression].
2121

Diff for: src/expressions/if-expr.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ r[expr.if.intro]
1616
An `if` expression is a conditional branch in program control.
1717
The syntax of an `if` expression is a condition operand, followed by a consequent block, any number of `else if` conditions and blocks, and an optional trailing `else` block.
1818

19-
r[expr.if.constraint]
19+
r[expr.if.condition-bool]
2020
The condition operands must have the [boolean type].
2121

2222
r[expr.if.condition-true]
@@ -152,7 +152,7 @@ if let E::X(n) | E::Y(n) = v {
152152
}
153153
```
154154

155-
r[expr.if.let.restriction]
155+
r[expr.if.let.lazy-bool]
156156
The expression cannot be a [lazy boolean operator expression][_LazyBooleanOperatorExpression_].
157157
Use of a lazy boolean operator is ambiguous with a planned feature change of the language (the implementation of if-let chains - see [eRFC 2947][_eRFCIfLetChain_]).
158158
When lazy boolean operator expression is desired, this can be achieved by using parenthesis as below:

Diff for: src/expressions/literal-expr.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ A character literal expression consists of a single [CHAR_LITERAL] token.
129129
r[expr.literal.char.type]
130130
The expression's type is the primitive [`char`][textual types] type.
131131
132-
r[expr.literal.char.restriction]
132+
r[expr.literal.char.no-suffix]
133133
The token must not have a suffix.
134134
135135
r[expr.literal.char.literal-content]
@@ -171,7 +171,7 @@ r[expr.literal.string.type]
171171
The expression's type is a shared reference (with `static` lifetime) to the primitive [`str`][textual types] type.
172172
That is, the type is `&'static str`.
173173

174-
r[expr.literal.string.restriction]
174+
r[expr.literal.string.no-suffix]
175175
The token must not have a suffix.
176176

177177
r[expr.literal.string.literal-content]
@@ -218,7 +218,7 @@ A byte literal expression consists of a single [BYTE_LITERAL] token.
218218
r[expr.literal.byte-char.literal]
219219
The expression's type is the primitive [`u8`][numeric types] type.
220220

221-
r[expr.literal.byte-char.restriction]
221+
r[expr.literal.byte-char.no-suffix]
222222
The token must not have a suffix.
223223

224224
r[expr.literal.byte-char.literal-content]
@@ -259,7 +259,7 @@ r[expr.literal.byte-string.type]
259259
The expression's type is a shared reference (with `static` lifetime) to an array whose element type is [`u8`][numeric types].
260260
That is, the type is `&'static [u8; N]`, where `N` is the number of bytes in the represented string described below.
261261

262-
r[expr.literal.byte-string.restriction]
262+
r[expr.literal.byte-string.no-suffix]
263263
The token must not have a suffix.
264264

265265
r[expr.literal.byte-string.literal-content]
@@ -308,7 +308,7 @@ r[expr.literal.c-string.type]
308308
The expression's type is a shared reference (with `static` lifetime) to the standard library [CStr] type.
309309
That is, the type is `&'static core::ffi::CStr`.
310310

311-
r[expr.literal.c-string.restriction]
311+
r[expr.literal.c-string.no-suffix]
312312
The token must not have a suffix.
313313

314314
r[expr.literal.c-string.literal-content]

Diff for: src/expressions/loop-expr.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ while let Some(v @ 1) | Some(v @ 2) = vals.pop() {
144144
}
145145
```
146146

147-
r[expr.loop.while.let.restriction]
147+
r[expr.loop.while.let.lazy-bool]
148148
As is the case in [`if let` expressions], the scrutinee cannot be a [lazy boolean operator expression][_LazyBooleanOperatorExpression_].
149149

150150
r[expr.loop.for]
@@ -302,7 +302,7 @@ Labelled block expressions are exactly like block expressions, except that they
302302
r[expr.loop.block-labels.break]
303303
Unlike loops, `break` expressions within a labelled block expression *must* have a label (i.e. the label is not optional).
304304

305-
r[expr.loop.block-labels.restriction]
305+
r[expr.loop.block-labels.label-required]
306306
Similarly, labelled block expressions *must* begin with a label.
307307

308308
```rust
@@ -344,7 +344,7 @@ In the case of a `for` loop, the head is the call-expression controlling the loo
344344
r[expr.loop.continue.label]
345345
Like `break`, `continue` is normally associated with the innermost enclosing loop, but `continue 'label` may be used to specify the loop affected.
346346

347-
r[expr.loop.continue.constraint]
347+
r[expr.loop.continue.in-loop-only]
348348
A `continue` expression is only permitted in the body of a loop.
349349

350350
r[expr.loop.break-value]

Diff for: src/expressions/match-expr.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ r[expr.match.guard.value]
151151
Only when the guard evaluates to true is the value moved, or copied, from the scrutinee into the variable.
152152
This allows shared borrows to be used inside guards without moving out of the scrutinee in case guard fails to match.
153153
154-
r[expr.match.guard.restriction]
154+
r[expr.match.guard.no-mutation]
155155
Moreover, by holding a shared reference while evaluating the guard, mutation inside guards is also prevented.
156156
157157
r[expr.match.attributes]

Diff for: src/expressions/method-call-expr.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Then, for each candidate type `T`, search for a [visible] method with a receiver
7171
r[expr.method.ambiguous-target]
7272
If this results in multiple possible candidates, then it is an error, and the receiver must be [converted][disambiguate call] to an appropriate receiver type to make the method call.
7373
74-
r[expr.method.constraint]
74+
r[expr.method.receiver-constraints]
7575
This process does not take into account the mutability or lifetime of the receiver, or whether a method is `unsafe`.
7676
Once a method is looked up, if it can't be called for one (or more) of those reasons, the result is a compiler error.
7777

Diff for: src/expressions/operator-expr.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ r[expr.try.syntax]
196196
r[expr.try.intro]
197197
The question mark operator (`?`) unwraps valid values or returns erroneous values, propagating them to the calling function.
198198

199-
r[expr.try.constraint]
199+
r[expr.try.restricted-types]
200200
It is a unary postfix operator that can only be applied to the types `Result<T, E>` and `Option<T>`.
201201

202202
r[expr.try.behavior-std-result]
@@ -358,7 +358,7 @@ r[expr.cmp.syntax]
358358
r[expr.cmp.intro]
359359
Comparison operators are also defined both for primitive types and many types in the standard library.
360360

361-
r[expr.cmp.restriction]
361+
r[expr.cmp.paren-chaining]
362362
Parentheses are required when chaining comparison operators. For example, the expression `a == b == c` is invalid and may be written as `(a == b) == c`.
363363

364364
r[expr.cmp.trait]
@@ -736,12 +736,12 @@ let (mut a, mut b) = (0, 1);
736736
(b, a) = (a, b);
737737
```
738738

739-
r[expr.assign.destructure.restriction]
739+
r[expr.assign.destructure.assignee]
740740
In contrast to destructuring declarations using `let`, patterns may not appear on the left-hand side of an assignment due to syntactic ambiguities.
741741
Instead, a group of expressions that correspond to patterns are designated to be [assignee expressions][assignee expression], and permitted on the left-hand side of an assignment.
742742
Assignee expressions are then desugared to pattern matches followed by sequential assignment.
743743

744-
r[expr.assign.destructure.constraint]
744+
r[expr.assign.destructure.irrefutable]
745745
The desugared patterns must be irrefutable: in particular, this means that only slice patterns whose length is known at compile-time, and the trivial slice `[..]`, are permitted for destructuring assignment.
746746

747747
The desugaring method is straightforward, and is illustrated best by example.
@@ -818,7 +818,7 @@ The syntax of compound assignment is a [mutable] [place expression], the *assign
818818
r[expr.compound-assign.place]
819819
Unlike other place operands, the assigned place operand must be a place expression.
820820

821-
r[expr.compound-assign.constraint]
821+
r[expr.compound-assign.no-value]
822822
Attempting to use a value expression is a compiler error rather than promoting it to a temporary.
823823

824824
r[expr.compound-assign.operand-order]

Diff for: src/expressions/struct-expr.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ r[expr.struct.update]
6868
r[expr.struct.update.intro]
6969
A struct expression that constructs a value of a struct type can terminate with the syntax `..` followed by an expression to denote a functional update.
7070

71-
r[expr.struct.update.constraint]
71+
r[expr.struct.update.base-same-type]
7272
The expression following `..` (the base) must have the same struct type as the new struct type being formed.
7373

7474
r[expr.struct.update.fields]
@@ -85,7 +85,7 @@ Point3d {y: 0, z: 10, .. base}; // OK, only base.x is accessed
8585
drop(y_ref);
8686
```
8787

88-
r[expr.struct.restriction]
88+
r[expr.struct.brace-restricted-positions]
8989
Struct expressions with curly braces can't be used directly in a [loop] or [if] expression's head, or in the [scrutinee] of an [if let] or [match] expression.
9090
However, struct expressions can be used in these situations if they are within another expression, for example inside [parentheses].
9191

Diff for: src/expressions/tuple-expr.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,14 @@ A *tuple indexing expression* accesses fields of [tuples][tuple type] and [tuple
5555

5656
The syntax for a tuple index expression is an expression, called the *tuple operand*, then a `.`, then finally a tuple index.
5757

58-
r[expr.tuple-index.restriction]
58+
r[expr.tuple-index.index-syntax]
5959
The syntax for the *tuple index* is a [decimal literal] with no leading zeros, underscores, or suffix.
6060
For example `0` and `2` are valid tuple indices but not `01`, `0_`, nor `0i32`.
6161

62-
r[expr.tuple-index.constraint]
62+
r[expr.tuple-index.required-type]
6363
The type of the tuple operand must be a [tuple type] or a [tuple struct].
64+
65+
r[expr.tuple-index.index-name-operand]
6466
The tuple index must be a name of a field of the type of the tuple operand.
6567

6668
r[expr.tuple-index.result]

Diff for: src/expressions/underscore-expr.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ r[expr.placeholder.intro]
1010
Underscore expressions, denoted with the symbol `_`, are used to signify a
1111
placeholder in a destructuring assignment.
1212

13-
r[expr.placeholder.constraint]
13+
r[expr.placeholder.lhs-assignment-only]
1414
They may only appear in the left-hand side of an assignment.
1515

1616
r[expr.placeholder.pattern]

0 commit comments

Comments
 (0)