|
10 | 10 |
|
11 | 11 | #![allow(non_snake_case)]
|
12 | 12 |
|
13 |
| -register_diagnostic! { E0001, r##" |
| 13 | +register_long_diagnostics! { |
| 14 | + E0001: r##" |
14 | 15 | This error suggests that the expression arm corresponding to the noted pattern
|
15 | 16 | will never be reached as for all possible values of the expression being matched,
|
16 | 17 | one of the preceeding patterns will match.
|
17 | 18 |
|
18 | 19 | This means that perhaps some of the preceeding patterns are too general, this
|
19 | 20 | one is too specific or the ordering is incorrect.
|
20 |
| -"## } |
| 21 | +"##, |
| 22 | + |
| 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 | +"##, |
| 28 | + |
| 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 | +
|
| 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". |
| 38 | +"##, |
| 39 | + |
| 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. |
| 45 | +"##, |
| 46 | + |
| 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. |
| 51 | +"## |
| 52 | +} |
21 | 53 |
|
22 | 54 | register_diagnostics! {
|
23 | 55 | E0002,
|
24 |
| - E0003, |
25 |
| - E0004, |
26 |
| - E0005, |
27 |
| - E0006, |
28 | 56 | E0007,
|
29 | 57 | E0008,
|
30 | 58 | E0009,
|
|
0 commit comments