Skip to content

Commit f400bfd

Browse files
committed
doc: Update 'alt' documentation to remove 'case' keyword
1 parent 1e5f163 commit f400bfd

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

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)