@@ -92,21 +92,23 @@ depends both on its own category and the context it occurs within.
92
92
93
93
A * place expression* is an expression that represents a memory location. These
94
94
expressions are [ paths] which refer to local variables, [ static variables] ,
95
- [ dereferences] & nbsp ; (` *expr ` ), [ array indexing] expressions (` expr[expr] ` ),
95
+ [ dereferences] [ deref ] (` *expr ` ), [ array indexing] expressions (` expr[expr] ` ),
96
96
[ field] references (` expr.f ` ) and parenthesized place expressions. All other
97
97
expressions are value expressions.
98
98
99
99
A * value expression* is an expression that represents an actual value.
100
100
101
101
The following contexts are * place expression* contexts:
102
102
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.
105
106
* The operand of a field expression.
106
107
* The indexed operand of an array indexing expression.
107
108
* The operand of any [ implicit borrow] .
108
109
* 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.
110
112
* The base of a [ functional update] struct expression.
111
113
112
114
> 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:
124
126
* [ Temporary values] ( #temporary-lifetimes ) .
125
127
* [ Fields] [ field ] of a place expression which can be moved out of and
126
128
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.
129
131
130
132
Moving out of a place expression that evaluates to a local variable, the
131
133
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:
146
148
* [ Temporary values] .
147
149
* [ Fields] [ field ] , this evaluates the subexpression in a mutable place
148
150
expression context.
149
- * [ Dereferences] of a ` *mut T ` pointer.
151
+ * [ Dereferences] [ deref ] of a ` *mut T ` pointer.
150
152
* Dereference of a variable, or field of a variable, with type ` &mut T ` . Note:
151
153
This is an exception to the requirement of the next rule.
152
154
* Dereferences of a type that implements ` DerefMut ` , this then requires that
@@ -244,7 +246,7 @@ Implicit borrows may be taken in the following expressions:
244
246
* Left operand in [ field] expressions.
245
247
* Left operand in [ call expressions] .
246
248
* Left operand in [ array indexing] expressions.
247
- * Operand of the [ dereference operator] \ (` * ` ).
249
+ * Operand of the [ dereference operator] [ deref ] (` * ` ).
248
250
* Operands of [ comparison] .
249
251
* Left operands of the [ compound assignment] .
250
252
@@ -286,13 +288,15 @@ They are never allowed before:
286
288
[ field ] : expressions/field-expr.html
287
289
[ functional update ] : expressions/struct-expr.html#functional-update-syntax
288
290
[ grouped ] : expressions/grouped-expr.html
291
+ [ `if let` ] : expressions/if-expr.html#if-let-expressions
289
292
[ literals ] : expressions/literal-expr.html
290
293
[ match ] : expressions/match-expr.html
291
294
[ method-call ] : expressions/method-call-expr.html
292
295
[ paths ] : expressions/path-expr.html
293
296
[ range expressions ] : expressions/range-expr.html
294
297
[ struct ] : expressions/struct-expr.html
295
298
[ tuple expressions ] : expressions/tuple-expr.html
299
+ [ `while let` ] : expressions/loop-expr.html#predicate-pattern-loops
296
300
297
301
[ array expressions ] : expressions/array-expr.html
298
302
[ array indexing ] : expressions/array-expr.html#array-and-slice-indexing-expressions
@@ -303,9 +307,7 @@ They are never allowed before:
303
307
[ cast ] : expressions/operator-expr.html#type-cast-expressions
304
308
[ comparison ] : expressions/operator-expr.html#comparison-operators
305
309
[ 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
309
311
[ lazy boolean ] : expressions/operator-expr.html#lazy-boolean-operators
310
312
[ negation ] : expressions/operator-expr.html#negation-operators
311
313
[ overflow ] : expressions/operator-expr.html#overflow
0 commit comments