Skip to content

Commit b1b905f

Browse files
committed
Correct definition of lvalues, fixes #10890
Signed-off-by: Edward Z. Yang <[email protected]>
1 parent 8f6df87 commit b1b905f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

doc/rust.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2177,7 +2177,11 @@ Expressions are divided into two main categories: _lvalues_ and _rvalues_.
21772177
Likewise within each expression, sub-expressions may occur in _lvalue context_ or _rvalue context_.
21782178
The evaluation of an expression depends both on its own category and the context it occurs within.
21792179

2180-
[Path](#path-expressions), [field](#field-expressions) and [index](#index-expressions) expressions are lvalues.
2180+
An lvalue is an expression that represents a memory location. These
2181+
expressions are [paths](#path-expressions) (which refer to local
2182+
variables, function and method arguments, or static variables),
2183+
dereferences (`*expr`), [indexing expressions](#index-expressions)
2184+
(`expr[expr]`), and [field references](#field-expressions) (`expr.f`).
21812185
All other expressions are rvalues.
21822186

21832187
The left operand of an [assignment](#assignment-expressions),

0 commit comments

Comments
 (0)