File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
src/librustc_error_codes/error_codes Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change 1
- In a match expression, only numbers and characters can be matched against a
2
- range. This is because the compiler checks that the range is non-empty at
3
- compile-time, and is unable to evaluate arbitrary comparison functions. If you
4
- want to capture values of an orderable type between two end-points, you can use
5
- a guard.
1
+ Something other than numbers and characters has been used for a range.
2
+
3
+ Erroneous code example:
6
4
7
5
``` compile_fail,E0029
8
6
let string = "salutations !";
@@ -20,3 +18,9 @@ match string {
20
18
_ => {}
21
19
}
22
20
```
21
+
22
+ In a match expression, only numbers and characters can be matched against a
23
+ range. This is because the compiler checks that the range is non-empty at
24
+ compile-time, and is unable to evaluate arbitrary comparison functions. If you
25
+ want to capture values of an orderable type between two end-points, you can use
26
+ a guard.
You can’t perform that action at this time.
0 commit comments