|
10 | 10 |
|
11 | 11 | #![allow(non_snake_case)]
|
12 | 12 |
|
| 13 | +// Error messages for EXXXX errors. |
| 14 | +// Each message should start and end with a new line, and be wrapped to 80 characters. |
| 15 | +// In vim you can `:set tw=80` and use `gq` to wrap paragraphs. Use `:set tw=0` to disable. |
13 | 16 | register_long_diagnostics! {
|
14 |
| - E0001: r##" |
15 |
| - This error suggests that the expression arm corresponding to the noted pattern |
16 |
| - will never be reached as for all possible values of the expression being matched, |
17 |
| - one of the preceding patterns will match. |
18 | 17 |
|
19 |
| - This means that perhaps some of the preceding patterns are too general, this |
20 |
| - one is too specific or the ordering is incorrect. |
| 18 | +E0001: r##" |
| 19 | +This error suggests that the expression arm corresponding to the noted pattern |
| 20 | +will never be reached as for all possible values of the expression being |
| 21 | +matched, one of the preceding patterns will match. |
| 22 | +
|
| 23 | +This means that perhaps some of the preceding patterns are too general, this one |
| 24 | +is too specific or the ordering is incorrect. |
21 | 25 | "##,
|
22 | 26 |
|
23 |
| - E0003: r##" |
24 |
| - Not-a-Number (NaN) values can not be compared for equality and hence can never match |
25 |
| - the input to a match expression. To match against NaN values, you should instead use |
26 |
| - the `is_nan` method in a guard, as in: x if x.is_nan() => ... |
| 27 | +E0003: r##" |
| 28 | +Not-a-Number (NaN) values can not be compared for equality and hence can never |
| 29 | +match the input to a match expression. To match against NaN values, you should |
| 30 | +instead use the `is_nan` method in a guard, as in: x if x.is_nan() => ... |
27 | 31 | "##,
|
28 | 32 |
|
29 |
| - E0004: r##" |
30 |
| - This error indicates that the compiler can not guarantee a matching pattern for one |
31 |
| - or more possible inputs to a match expression. Guaranteed matches are required in order |
32 |
| - to assign values to match expressions, or alternatively, determine the flow of execution. |
| 33 | +E0004: r##" |
| 34 | +This error indicates that the compiler can not guarantee a matching pattern for |
| 35 | +one or more possible inputs to a match expression. Guaranteed matches are |
| 36 | +required in order to assign values to match expressions, or alternatively, |
| 37 | +determine the flow of execution. |
33 | 38 |
|
34 |
| - If you encounter this error you must alter your patterns so that every possible value of |
35 |
| - the input type is matched. For types with a small number of variants (like enums) you |
36 |
| - should probably cover all cases explicitly. Alternatively, the underscore `_` wildcard |
37 |
| - pattern can be added after all other patterns to match "anything else". |
| 39 | +If you encounter this error you must alter your patterns so that every possible |
| 40 | +value of the input type is matched. For types with a small number of variants |
| 41 | +(like enums) you should probably cover all cases explicitly. Alternatively, the |
| 42 | +underscore `_` wildcard pattern can be added after all other patterns to match |
| 43 | +"anything else". |
38 | 44 | "##,
|
39 | 45 |
|
40 |
| - // FIXME: Remove duplication here? |
41 |
| - E0005: r##" |
42 |
| - Patterns used to bind names must be irrefutable, that is, they must guarantee that a |
43 |
| - name will be extracted in all cases. If you encounter this error you probably need |
44 |
| - to use a `match` or `if let` to deal with the possibility of failure. |
| 46 | +// FIXME: Remove duplication here? |
| 47 | +E0005: r##" |
| 48 | +Patterns used to bind names must be irrefutable, that is, they must guarantee that a |
| 49 | +name will be extracted in all cases. If you encounter this error you probably need |
| 50 | +to use a `match` or `if let` to deal with the possibility of failure. |
45 | 51 | "##,
|
46 | 52 |
|
47 |
| - E0006: r##" |
48 |
| - Patterns used to bind names must be irrefutable, that is, they must guarantee that a |
49 |
| - name will be extracted in all cases. If you encounter this error you probably need |
50 |
| - to use a `match` or `if let` to deal with the possibility of failure. |
| 53 | +E0006: r##" |
| 54 | +Patterns used to bind names must be irrefutable, that is, they must guarantee that a |
| 55 | +name will be extracted in all cases. If you encounter this error you probably need |
| 56 | +to use a `match` or `if let` to deal with the possibility of failure. |
51 | 57 | "##
|
| 58 | + |
52 | 59 | }
|
53 | 60 |
|
54 | 61 | register_diagnostics! {
|
|
0 commit comments