Skip to content

Commit 5092757

Browse files
authored
Merge pull request #2189 from bitcp/add-to-place-expr-context
Fix an EN grammar error & add an item to place expr context list
2 parents c1dc765 + 928d606 commit 5092757

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

src/expressions.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,9 @@ The following contexts are *place expression* contexts:
165165

166166
* The left operand of a [compound assignment] expression.
167167
* The operand of a unary [borrow], [raw borrow] or [dereference][deref] operator.
168-
* The operand of a field expression.
169-
* The indexed operand of an array indexing expression.
168+
* The operand of a [field expression].
169+
* The indexed operand of an [array indexing expression].
170+
* The tuple operand of a [tuple indexing expression].
170171
* The operand of any [implicit borrow].
171172
* The initializer of a [let statement].
172173
* The [scrutinee] of an [`if let`], [`match`][match], or [`while let`] expression.
@@ -377,6 +378,7 @@ They are never allowed before:
377378
[`while let`]: expressions/loop-expr.md#while-let-patterns
378379
[array expressions]: expressions/array-expr.md
379380
[array indexing]: expressions/array-expr.md#array-and-slice-indexing-expressions
381+
[array indexing expression]: expr.array.index
380382
[assign]: expressions/operator-expr.md#assignment-expressions
381383
[block expressions]: expressions/block-expr.md
382384
[borrow]: expressions/operator-expr.md#borrow-operators
@@ -390,6 +392,7 @@ They are never allowed before:
390392
[extending expression]: destructors.scope.lifetime-extension.exprs
391393
[extending expressions]: destructors.scope.lifetime-extension.exprs
392394
[field]: expressions/field-expr.md
395+
[field expression]: expr.field
393396
[functional update]: expressions/struct-expr.md#functional-update-syntax
394397
[implicit borrow]: #implicit-borrows
395398
[implicitly borrowed]: expr.implicit-borrow
@@ -416,6 +419,7 @@ They are never allowed before:
416419
[temporary scopes]: destructors.scope.temporary
417420
[Temporary values]: #temporaries
418421
[tuple expressions]: expressions/tuple-expr.md
422+
[tuple indexing expression]: expr.tuple-index
419423
[Tuple structs]: items.struct.tuple
420424
[Tuples]: expressions/tuple-expr.md
421425
[Underscores]: expressions/underscore-expr.md

src/items/traits.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ r[items.traits.impls]
3131
Traits are implemented for specific types through separate [implementations].
3232

3333
r[items.traits.associated-item-decls]
34-
Trait functions may omit the function body by replacing it with a semicolon. This indicates that the implementation must define the function. If the trait function defines a body, this definition acts as a default for any implementation which does not override it. Similarly, associated constants may omit the equals sign and expression to indicate implementations must define the constant value. Associated types must never define the type, the type may only be specified in an implementation.
34+
Trait functions may omit the function body by replacing it with a semicolon. This indicates that the implementation must define the function. If the trait function defines a body, this definition acts as a default for any implementation which does not override it. Similarly, associated constants may omit the equal sign and expression to indicate implementations must define the constant value. Associated types must never define the type, the type may only be specified in an implementation.
3535

3636
```rust
3737
// Examples of associated trait items with and without definitions.

0 commit comments

Comments
 (0)