File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
8
refs/heads/try2: a810c03263670238bccd64cabb12a23a46e3a278
9
9
refs/heads/incoming: e90142e536c150df0d9b4b2f11352152177509b5
10
- refs/heads/dist-snap: 31a4f40329bec3507ed014700c7d91b1697875e3
10
+ refs/heads/dist-snap: b4501f4c64501a8ac738288665a0499ecb0aa9b8
11
11
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
12
12
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
13
13
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
Original file line number Diff line number Diff line change @@ -2244,8 +2244,9 @@ The compiler interprets a variable pattern `x` as a binding _only_ if there is n
2244
2244
A convention you can use to avoid conflicts is simply to name variants with upper-case letters,
2245
2245
and local variables with lower-case letters.
2246
2246
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:
2249
2250
2250
2251
~~~~
2251
2252
# let x = 2;
@@ -2257,6 +2258,10 @@ let message = match x {
2257
2258
};
2258
2259
~~~~
2259
2260
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
+
2260
2265
Finally, match patterns can accept * pattern guards* to further refine the
2261
2266
criteria for matching a case. Pattern guards appear after the pattern and
2262
2267
consist of a bool-typed expression following the ` if ` keyword. A pattern
You can’t perform that action at this time.
0 commit comments