diff options
Diffstat (limited to 'src/librustc_error_codes/error_codes')
| -rw-r--r-- | src/librustc_error_codes/error_codes/E0029.md | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/librustc_error_codes/error_codes/E0029.md b/src/librustc_error_codes/error_codes/E0029.md index fadfda0a80c..d12d85b9b4c 100644 --- a/src/librustc_error_codes/error_codes/E0029.md +++ b/src/librustc_error_codes/error_codes/E0029.md @@ -1,8 +1,6 @@ -In a match expression, only numbers and characters can be matched against a -range. This is because the compiler checks that the range is non-empty at -compile-time, and is unable to evaluate arbitrary comparison functions. If you -want to capture values of an orderable type between two end-points, you can use -a guard. +Something other than numbers and characters has been used for a range. + +Erroneous code example: ```compile_fail,E0029 let string = "salutations !"; @@ -20,3 +18,9 @@ match string { _ => {} } ``` + +In a match expression, only numbers and characters can be matched against a +range. This is because the compiler checks that the range is non-empty at +compile-time, and is unable to evaluate arbitrary comparison functions. If you +want to capture values of an orderable type between two end-points, you can use +a guard. |
