diff --git a/doc/rust.texi b/doc/rust.texi index 5024dd47ed3a0..fcca023d2553e 100644 --- a/doc/rust.texi +++ b/doc/rust.texi @@ -2133,7 +2133,7 @@ tag list @{ cons(T, @@list); @} -let a: list = cons(7, cons(13, nil)); +let a: list = cons(7, @@cons(13, @@nil)); @end example @@ -3353,26 +3353,25 @@ equal the type of the head expression. To execute a pattern @code{alt} expression, first the head expression is evaluated, then its value is sequentially compared to the patterns in the arms -until a match is found. The first arm with a matching @code{case} pattern is -chosen as the branch target of the @code{alt}, any variables bound by the -pattern are assigned to local slots in the arm's block, and control enters the -block. +until a match is found. The first arm with a matching pattern is chosen as the +branch target of the @code{alt}, any variables bound by the pattern are +assigned to local slots in the arm's block, and control enters the block. An example of a pattern @code{alt} expression: @example -type list = tag(nil, cons(X, @@list)); +tag list @{ nil; cons(X, @@list); @} -let x: list = cons(10, cons(11, nil)); +let x: list = cons(10, @@cons(11, @@nil)); alt x @{ - case (cons(a, cons(b, _))) @{ + cons(a, @@cons(b, _)) @{ process_pair(a,b); @} - case (cons(v=10, _)) @{ - process_ten(v); + cons(10, _) @{ + process_ten(); @} - case (_) @{ + _ @{ fail; @} @}