Skip to content

Commit 37b648a

Browse files
committed
Address review comments
1 parent 6e1eef6 commit 37b648a

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

src/expressions.md

+13-11
Original file line numberDiff line numberDiff line change
@@ -92,21 +92,23 @@ depends both on its own category and the context it occurs within.
9292

9393
A *place expression* is an expression that represents a memory location. These
9494
expressions are [paths] which refer to local variables, [static variables],
95-
[dereferences] (`*expr`), [array indexing] expressions (`expr[expr]`),
95+
[dereferences][deref] (`*expr`), [array indexing] expressions (`expr[expr]`),
9696
[field] references (`expr.f`) and parenthesized place expressions. All other
9797
expressions are value expressions.
9898

9999
A *value expression* is an expression that represents an actual value.
100100

101101
The following contexts are *place expression* contexts:
102102

103-
* The left operand of an [assignment][assign] or [compound assignment] expression.
104-
* The operand of a unary [borrow] or [dereference] operator.
103+
* The left operand of an [assignment][assign] or [compound assignment]
104+
expression.
105+
* The operand of a unary [borrow] or [dereference][deref] operator.
105106
* The operand of a field expression.
106107
* The indexed operand of an array indexing expression.
107108
* The operand of any [implicit borrow].
108109
* The initializer of a [let statement].
109-
* The [scrutinee] of a [match expression][match].
110+
* The [scrutinee] of a [`if let`], [`match`][match] or [`while let`]
111+
expression.
110112
* The base of a [functional update] struct expression.
111113

112114
> Note: Historically, place expressions were called *lvalues* and value
@@ -124,8 +126,8 @@ move the value. Only the following place expressions may be moved out of:
124126
* [Temporary values](#temporary-lifetimes).
125127
* [Fields][field] of a place expression which can be moved out of and
126128
doesn't implement [`Drop`].
127-
* The result of [dereferencing] an expression with type [`Box<T>`] and that can
128-
also be moved out of.
129+
* The result of [dereferencing][deref] an expression with type [`Box<T>`] and
130+
that can also be moved out of.
129131

130132
Moving out of a place expression that evaluates to a local variable, the
131133
location is deinitialized and cannot be read from again until it is
@@ -146,7 +148,7 @@ The following expressions can be mutable place expression contexts:
146148
* [Temporary values].
147149
* [Fields][field], this evaluates the subexpression in a mutable place
148150
expression context.
149-
* [Dereferences] of a `*mut T` pointer.
151+
* [Dereferences][deref] of a `*mut T` pointer.
150152
* Dereference of a variable, or field of a variable, with type `&mut T`. Note:
151153
This is an exception to the requirement of the next rule.
152154
* Dereferences of a type that implements `DerefMut`, this then requires that
@@ -244,7 +246,7 @@ Implicit borrows may be taken in the following expressions:
244246
* Left operand in [field] expressions.
245247
* Left operand in [call expressions].
246248
* Left operand in [array indexing] expressions.
247-
* Operand of the [dereference operator] \(`*`).
249+
* Operand of the [dereference operator][deref] (`*`).
248250
* Operands of [comparison].
249251
* Left operands of the [compound assignment].
250252

@@ -286,13 +288,15 @@ They are never allowed before:
286288
[field]: expressions/field-expr.html
287289
[functional update]: expressions/struct-expr.html#functional-update-syntax
288290
[grouped]: expressions/grouped-expr.html
291+
[`if let`]: expressions/if-expr.html#if-let-expressions
289292
[literals]: expressions/literal-expr.html
290293
[match]: expressions/match-expr.html
291294
[method-call]: expressions/method-call-expr.html
292295
[paths]: expressions/path-expr.html
293296
[range expressions]: expressions/range-expr.html
294297
[struct]: expressions/struct-expr.html
295298
[tuple expressions]: expressions/tuple-expr.html
299+
[`while let`]: expressions/loop-expr.html#predicate-pattern-loops
296300

297301
[array expressions]: expressions/array-expr.html
298302
[array indexing]: expressions/array-expr.html#array-and-slice-indexing-expressions
@@ -303,9 +307,7 @@ They are never allowed before:
303307
[cast]: expressions/operator-expr.html#type-cast-expressions
304308
[comparison]: expressions/operator-expr.html#comparison-operators
305309
[compound assignment]: expressions/operator-expr.html#compound-assignment-expressions
306-
[dereferences]: expressions/operator-expr.html#the-dereference-operator
307-
[dereferencing]: expressions/operator-expr.html#the-dereference-operator
308-
[dereference operator]: expressions/operator-expr.html#the-dereference-operator
310+
[deref]: expressions/operator-expr.html#the-dereference-operator
309311
[lazy boolean]: expressions/operator-expr.html#lazy-boolean-operators
310312
[negation]: expressions/operator-expr.html#negation-operators
311313
[overflow]: expressions/operator-expr.html#overflow

src/expressions/struct-expr.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ expression to denote a functional update. The expression following `..` (the
6363
base) must have the same struct type as the new struct type being formed.
6464

6565
The entire expression uses the given values for the fields that were specified
66-
and moves or copies the remaining fields from the base expression. Just as with
67-
all struct expressions, all of the fields of the struct must be [visible], even
66+
and moves or copies the remaining fields from the base expression. As with all
67+
struct expressions, all of the fields of the struct must be [visible], even
6868
those not explicitly named.
6969

7070
```rust

0 commit comments

Comments
 (0)