]> git.lizzy.rs Git - rust.git/blob - src/librustc/diagnostics.rs
rollup merge of #21438: taralx/kill-racycell
[rust.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 preceeding patterns will match.
18
19     This means that perhaps some of the preceeding 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     E0014,
63     E0015,
64     E0016,
65     E0017,
66     E0018,
67     E0019,
68     E0020,
69     E0022,
70     E0109,
71     E0110,
72     E0133,
73     E0134,
74     E0135,
75     E0136,
76     E0137,
77     E0138,
78     E0139,
79     E0152,
80     E0158,
81     E0161,
82     E0162,
83     E0165,
84     E0170,
85     E0261, // use of undeclared lifetime name
86     E0262, // illegal lifetime parameter name
87     E0263, // lifetime name declared twice in same scope
88     E0264, // unknown external lang item
89     E0265, // recursive constant
90     E0266, // expected item
91     E0267, // thing inside of a closure
92     E0268, // thing outside of a loop
93     E0269, // not all control paths return a value
94     E0270, // computation may converge in a function marked as diverging
95     E0271, // type mismatch resolving
96     E0272, // rustc_on_unimplemented attribute refers to non-existent type parameter
97     E0273, // rustc_on_unimplemented must have named format arguments
98     E0274, // rustc_on_unimplemented must have a value
99     E0275, // overflow evaluating requirement
100     E0276, // requirement appears on impl method but not on corresponding trait method
101     E0277, // trait is not implemented for type
102     E0278, // requirement is not satisfied
103     E0279, // requirement is not satisfied
104     E0280, // requirement is not satisfied
105     E0281, // type implements trait but other trait is required
106     E0282, // unable to infer enough type information about
107     E0283, // cannot resolve type
108     E0284, // cannot resolve type
109     E0285, // overflow evaluation builtin bounds
110     E0296, // malformed recursion limit attribute
111     E0297, // refutable pattern in for loop binding
112     E0298, // mismatched types between arms
113     E0299, // mismatched types between arms
114     E0300, // unexpanded macro
115     E0301, // cannot mutable borrow in a pattern guard
116     E0302, // cannot assign in a pattern guard
117     E0303, // pattern bindings are not allowed after an `@`
118     E0304, // expected signed integer constant
119     E0305, // expected constant
120     E0306, // expected positive integer for repeat count
121     E0307, // expected constant integer for repeat count
122     E0308,
123     E0309, // thing may not live long enough
124     E0310, // thing may not live long enough
125     E0311, // thing may not live long enough
126     E0312, // lifetime of reference outlives lifetime of borrowed content
127     E0313, // lifetime of borrowed pointer outlives lifetime of captured variable
128     E0314, // closure outlives stack frame
129     E0315 // cannot invoke closure outside of its lifetime
130 }
131
132 __build_diagnostic_array! { DIAGNOSTICS }
133