Skip to content

Commit 64b12bf

Browse files
committed
---
yaml --- r: 36590 b: refs/heads/try2 c: b4501f4 h: refs/heads/master v: v3
1 parent f7daced commit 64b12bf

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: eb8fd119c65c67f3b1b8268cc7341c22d39b7b61
55
refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 31a4f40329bec3507ed014700c7d91b1697875e3
8+
refs/heads/try2: b4501f4c64501a8ac738288665a0499ecb0aa9b8
99
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
1010
refs/heads/dist-snap: 22efa39382d41b084fde1719df7ae8ce5697d8c9
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try2/doc/rust.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2244,8 +2244,9 @@ The compiler interprets a variable pattern `x` as a binding _only_ if there is n
22442244
A convention you can use to avoid conflicts is simply to name variants with upper-case letters,
22452245
and local variables with lower-case letters.
22462246

2247-
Multiple match patterns may be joined with the `|` operator. A
2248-
range of values may be specified with `..`. For example:
2247+
Multiple match patterns may be joined with the `|` operator.
2248+
A range of values may be specified with `..`.
2249+
For example:
22492250

22502251
~~~~
22512252
# let x = 2;
@@ -2257,6 +2258,10 @@ let message = match x {
22572258
};
22582259
~~~~
22592260

2261+
Range patterns only work on scalar types
2262+
(like integers and characters; not like vectors and structs, which have sub-components).
2263+
A range pattern may not be a sub-range of another range pattern inside the same `match`.
2264+
22602265
Finally, match patterns can accept *pattern guards* to further refine the
22612266
criteria for matching a case. Pattern guards appear after the pattern and
22622267
consist of a bool-typed expression following the `if` keyword. A pattern

0 commit comments

Comments
 (0)