Skip to content

Commit 3beea15

Browse files
committed
---
yaml --- r: 7535 b: refs/heads/master c: 6ffc36b h: refs/heads/master i: 7533: 07844ec 7531: 9152ab0 7527: 4dfd3d4 7519: 686bcea v: v3
1 parent 821cbfe commit 3beea15

File tree

2 files changed

+19
-24
lines changed

2 files changed

+19
-24
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 59ebe6af187ce0504b40c177f1700b090b226625
2+
refs/heads/master: 6ffc36bb1bdcb5f4c66e7ef539daffaf21ca2627

trunk/doc/rust.md

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1290,24 +1290,6 @@ Rust has two kinds of statement:
12901290
[declaration statements](#declaration-statements) and
12911291
[expression statements](#expression-statements).
12921292

1293-
A declaration serves to introduce a *name* that can be used in the block
1294-
*scope* enclosing the statement: all statements before and after the
1295-
name, from the previous opening curly-brace (`{`) up to the next closing
1296-
curly-brace (`}`).
1297-
1298-
An expression plays the dual roles of causing side effects and producing a
1299-
*value*. Expressions are said to *evaluate to* a value, and the side effects
1300-
are caused during *evaluation*. Many expressions contain sub-expressions as
1301-
operands; the definition of each kind of expression dictates whether or not,
1302-
and in which order, it will evaluate its sub-expressions, and how the
1303-
expression's value derives from the value of its sub-expressions.
1304-
1305-
In this way, the structure of execution -- both the overall sequence of
1306-
observable side effects and the final produced value -- is dictated by the
1307-
structure of expressions. Blocks themselves are expressions, so the nesting
1308-
sequence of block, statement, expression, and block can repeatedly nest to an
1309-
arbitrary depth.
1310-
13111293
### Declaration statements
13121294

13131295
A _declaration statement_ is one that introduces a *name* into the enclosing
@@ -1363,6 +1345,19 @@ the side effects of the expression's evaluation.
13631345

13641346
## Expressions
13651347

1348+
An expression plays the dual roles of causing side effects and producing a
1349+
*value*. Expressions are said to *evaluate to* a value, and the side effects
1350+
are caused during *evaluation*. Many expressions contain sub-expressions as
1351+
operands; the definition of each kind of expression dictates whether or not,
1352+
and in which order, it will evaluate its sub-expressions, and how the
1353+
expression's value derives from the value of its sub-expressions.
1354+
1355+
In this way, the structure of execution -- both the overall sequence of
1356+
observable side effects and the final produced value -- is dictated by the
1357+
structure of expressions. Blocks themselves are expressions, so the nesting
1358+
sequence of block, statement, expression, and block can repeatedly nest to an
1359+
arbitrary depth.
1360+
13661361
### Literal expressions
13671362

13681363
A _literal expression_ consists of one of the [literal](#literals)
@@ -1759,7 +1754,7 @@ let x = ~10;
17591754
let y = [move x];
17601755
~~~~
17611756

1762-
Any access to `y` after applying the `move` operator to it is invalid,
1757+
Any access to `x` after applying the `move` operator to it is invalid,
17631758
since it is no longer initialized at that point.
17641759

17651760
### Call expressions
@@ -1770,10 +1765,10 @@ paren_expr_list : '(' expr_list ')' ;
17701765
call_expr : expr paren_expr_list ;
17711766
~~~~~~~~
17721767

1773-
A _call expression_ invokes a function, providing a tuple of input slots
1774-
and a reference slot to serve as the function's output, bound to the
1775-
`lval` on the right hand side of the call. If the function eventually
1776-
returns, then the expression completes.
1768+
A _call expression_ invokes a function, providing zero or more input slots and
1769+
an optional reference slot to serve as the function's output, bound to the
1770+
`lval` on the right hand side of the call. If the function eventually returns,
1771+
then the expression completes.
17771772

17781773
A call expression statically requires that the precondition declared in the
17791774
callee's signature is satisfied by the expression prestate. In this way,

0 commit comments

Comments
 (0)