Skip to content

Commit f8d575a

Browse files
Clean up E0029
1 parent 8650628 commit f8d575a

File tree

1 file changed

+9
-5
lines changed
  • src/librustc_error_codes/error_codes

1 file changed

+9
-5
lines changed

src/librustc_error_codes/error_codes/E0029.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
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:
64

75
```compile_fail,E0029
86
let string = "salutations !";
@@ -20,3 +18,9 @@ match string {
2018
_ => {}
2119
}
2220
```
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.

0 commit comments

Comments
 (0)