Skip to content

Commit d8abc0f

Browse files
committed
---
yaml --- r: 5842 b: refs/heads/master c: f400bfd h: refs/heads/master v: v3
1 parent dd51feb commit d8abc0f

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
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: 1e5f163eec5ce4c9dfc734d12c8cd2d2accdff10
2+
refs/heads/master: f400bfd8fdce370a8ee29ee250ebb48a1c005ad6

trunk/doc/rust.texi

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3353,10 +3353,9 @@ equal the type of the head expression.
33533353

33543354
To execute a pattern @code{alt} expression, first the head expression is
33553355
evaluated, then its value is sequentially compared to the patterns in the arms
3356-
until a match is found. The first arm with a matching @code{case} pattern is
3357-
chosen as the branch target of the @code{alt}, any variables bound by the
3358-
pattern are assigned to local slots in the arm's block, and control enters the
3359-
block.
3356+
until a match is found. The first arm with a matching pattern is chosen as the
3357+
branch target of the @code{alt}, any variables bound by the pattern are
3358+
assigned to local slots in the arm's block, and control enters the block.
33603359

33613360
An example of a pattern @code{alt} expression:
33623361

@@ -3366,13 +3365,13 @@ type list<X> = tag(nil, cons(X, @@list<X>));
33663365
let x: list<int> = cons(10, cons(11, nil));
33673366
33683367
alt x @{
3369-
case (cons(a, cons(b, _))) @{
3368+
cons(a, cons(b, _)) @{
33703369
process_pair(a,b);
33713370
@}
3372-
case (cons(v=10, _)) @{
3371+
cons(v=10, _) @{
33733372
process_ten(v);
33743373
@}
3375-
case (_) @{
3374+
_ @{
33763375
fail;
33773376
@}
33783377
@}

0 commit comments

Comments
 (0)