Skip to content

Commit 1e5f163

Browse files
mbrubeckbrson
authored andcommitted
doc: 'alt' expressions no longer require parens
1 parent 9e8076c commit 1e5f163

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

doc/rust.texi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3347,9 +3347,9 @@ expression following the @code{alt} when the case block completes.
33473347
A pattern @code{alt} expression branches on a @emph{pattern}. The exact form of
33483348
matching that occurs depends on the pattern. Patterns consist of some
33493349
combination of literals, tag constructors, variable binding specifications and
3350-
placeholders (@code{_}). A pattern @code{alt} has a parenthesized @emph{head
3351-
expression}, which is the value to compare to the patterns. The type of the
3352-
patterns must equal the type of the head expression.
3350+
placeholders (@code{_}). A pattern @code{alt} has a @emph{head expression},
3351+
which is the value to compare to the patterns. The type of the patterns must
3352+
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
@@ -3365,7 +3365,7 @@ type list<X> = tag(nil, cons(X, @@list<X>));
33653365
33663366
let x: list<int> = cons(10, cons(11, nil));
33673367
3368-
alt (x) @{
3368+
alt x @{
33693369
case (cons(a, cons(b, _))) @{
33703370
process_pair(a,b);
33713371
@}

0 commit comments

Comments
 (0)