Skip to content

Commit b08896c

Browse files
committed
---
yaml --- r: 6033 b: refs/heads/master c: 6afecc3 h: refs/heads/master i: 6031: d069b44 v: v3
1 parent a132848 commit b08896c

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
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: ba1df0eda9b0b36ef2f7b2dd69535621ca35ffb2
2+
refs/heads/master: 6afecc37e33713de6b372e4bfa9c348f9de4aab6

trunk/doc/rust.texi

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3396,12 +3396,21 @@ alt x @{
33963396
cons(10, _) @{
33973397
process_ten();
33983398
@}
3399+
nil. @{
3400+
ret;
3401+
@}
33993402
_ @{
34003403
fail;
34013404
@}
34023405
@}
34033406
@end example
34043407

3408+
Note in the above example that @code{nil} is followed by a period. This is
3409+
required syntax for pattern matching a nullary tag variant, to distingush the
3410+
variant @code{nil} from a binding to variable @code{nil}. Without the period
3411+
the value of @code{x} would be bound to variable @code{nil} and the compiler
3412+
would issue an error about the final wildcard case being unreachable.
3413+
34053414
Multiple alternative patterns may be joined with the @code{|} operator. A
34063415
range of values may be specified with @code{to}. For example:
34073416

0 commit comments

Comments
 (0)