]> git.proxmox.com Git - rustc.git/blob - src/librustc/diagnostics.rs
Imported Upstream version 1.0.0~beta
[rustc.git] / src / librustc / diagnostics.rs
1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 #![allow(non_snake_case)]
12
13 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
19 This means that perhaps some of the preceding patterns are too general, this
20 one is too specific or the ordering is incorrect.
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 }
53
54 register_diagnostics! {
55 E0002,
56 E0007,
57 E0008,
58 E0009,
59 E0010,
60 E0011,
61 E0012,
62 E0013,
63 E0014,
64 E0015,
65 E0016,
66 E0017,
67 E0018,
68 E0019,
69 E0020,
70 E0022,
71 E0079, // enum variant: expected signed integer constant
72 E0080, // enum variant: constant evaluation error
73 E0109,
74 E0110,
75 E0133,
76 E0134,
77 E0135,
78 E0136,
79 E0137,
80 E0138,
81 E0139,
82 E0152,
83 E0158,
84 E0161,
85 E0162,
86 E0165,
87 E0170,
88 E0261, // use of undeclared lifetime name
89 E0262, // illegal lifetime parameter name
90 E0263, // lifetime name declared twice in same scope
91 E0264, // unknown external lang item
92 E0265, // recursive constant
93 E0266, // expected item
94 E0267, // thing inside of a closure
95 E0268, // thing outside of a loop
96 E0269, // not all control paths return a value
97 E0270, // computation may converge in a function marked as diverging
98 E0271, // type mismatch resolving
99 E0272, // rustc_on_unimplemented attribute refers to non-existent type parameter
100 E0273, // rustc_on_unimplemented must have named format arguments
101 E0274, // rustc_on_unimplemented must have a value
102 E0275, // overflow evaluating requirement
103 E0276, // requirement appears on impl method but not on corresponding trait method
104 E0277, // trait is not implemented for type
105 E0278, // requirement is not satisfied
106 E0279, // requirement is not satisfied
107 E0280, // requirement is not satisfied
108 E0281, // type implements trait but other trait is required
109 E0282, // unable to infer enough type information about
110 E0283, // cannot resolve type
111 E0284, // cannot resolve type
112 E0285, // overflow evaluation builtin bounds
113 E0296, // malformed recursion limit attribute
114 E0297, // refutable pattern in for loop binding
115 E0298, // mismatched types between arms
116 E0299, // mismatched types between arms
117 E0300, // unexpanded macro
118 E0301, // cannot mutable borrow in a pattern guard
119 E0302, // cannot assign in a pattern guard
120 E0303, // pattern bindings are not allowed after an `@`
121 E0304, // expected signed integer constant
122 E0305, // expected constant
123 E0306, // expected positive integer for repeat count
124 E0307, // expected constant integer for repeat count
125 E0308,
126 E0309, // thing may not live long enough
127 E0310, // thing may not live long enough
128 E0311, // thing may not live long enough
129 E0312, // lifetime of reference outlives lifetime of borrowed content
130 E0313, // lifetime of borrowed pointer outlives lifetime of captured variable
131 E0314, // closure outlives stack frame
132 E0315, // cannot invoke closure outside of its lifetime
133 E0316, // nested quantification of lifetimes
134 E0370 // discriminant overflow
135 }
136
137 __build_diagnostic_array! { DIAGNOSTICS }