Skip to content

Commit 30d3e02

Browse files
committed
---
yaml --- r: 31062 b: refs/heads/incoming c: cb4c747 h: refs/heads/master v: v3
1 parent c217ba2 commit 30d3e02

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
9-
refs/heads/incoming: 6c2c6947256db3841ceb3253ebace259a72dd917
9+
refs/heads/incoming: cb4c747e9f6b51f8e44caab27ca376b59df3a56d
1010
refs/heads/dist-snap: 2f32a1581f522e524009138b33b1c7049ced668d
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/doc/rust.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1468,6 +1468,25 @@ structure of expressions. Blocks themselves are expressions, so the nesting
14681468
sequence of block, statement, expression, and block can repeatedly nest to an
14691469
arbitrary depth.
14701470

1471+
#### Lvalues, rvalues and temporaries
1472+
1473+
Expressions are divided into two main categories: _lvalues_ and _rvalues_.
1474+
Likewise within each expression, sub-expressions may occur in _lvalue context_ or _rvalue context_.
1475+
The evaluation of an expression depends both on its own category and the context it occurs within.
1476+
1477+
Path, field and index expressions are lvalues.
1478+
All other expressions are rvalues.
1479+
1480+
The left operand of an assignment expression and the operand of the borrow operator are lvalue contexts.
1481+
All other expression contexts are rvalue contexts.
1482+
1483+
When an lvalue is evaluated in an _lvalue context_, it denotes a memory location;
1484+
when evaluated in an _rvalue context_, it denotes the value held _in_ that memory location.
1485+
1486+
When an rvalue is used in lvalue context, a temporary un-named lvalue is created and used instead.
1487+
A temporary's lifetime equals the largest lifetime of any borrowed pointer that points to it.
1488+
1489+
14711490
### Literal expressions
14721491

14731492
A _literal expression_ consists of one of the [literal](#literals)

0 commit comments

Comments
 (0)