File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
8
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
9
- refs/heads/incoming: 6c2c6947256db3841ceb3253ebace259a72dd917
9
+ refs/heads/incoming: cb4c747e9f6b51f8e44caab27ca376b59df3a56d
10
10
refs/heads/dist-snap: 2f32a1581f522e524009138b33b1c7049ced668d
11
11
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
12
12
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
Original file line number Diff line number Diff line change @@ -1468,6 +1468,25 @@ structure of expressions. Blocks themselves are expressions, so the nesting
1468
1468
sequence of block, statement, expression, and block can repeatedly nest to an
1469
1469
arbitrary depth.
1470
1470
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
+
1471
1490
### Literal expressions
1472
1491
1473
1492
A _ literal expression_ consists of one of the [ literal] ( #literals )
You can’t perform that action at this time.
0 commit comments