1
- // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
1
+ // Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2
2
// file at the top-level directory of this distribution and at
3
3
// http://rust-lang.org/COPYRIGHT.
4
4
//
15
15
// In vim you can `:set tw=80` and use `gq` to wrap paragraphs. Use `:set tw=0` to disable.
16
16
register_long_diagnostics ! {
17
17
18
- E0533 : r##"
19
- ```compile_fail,E0533
20
- #[export_name]
18
+ E0534 : r##"
19
+ The `inline` attribute was malformed.
20
+
21
+ Erroneous code example:
22
+
23
+ ```compile_fail,E0534
24
+ #[inline()] // error: expected one argument
25
+ pub fn something() {}
26
+
27
+ fn main() {}
28
+ ```
29
+
30
+ The parenthesized `inline` attribute requires the parameter to be specified:
31
+
32
+ ```ignore
33
+ #[inline(always)]
34
+ fn something() {}
35
+
36
+ // or:
37
+
38
+ #[inline(never)]
39
+ fn something() {}
40
+ ```
41
+
42
+ Alternatively, a paren-less version of the attribute may be used to hint the
43
+ compiler about inlining opportunity:
44
+
45
+ ```
46
+ #[inline]
47
+ fn something() {}
48
+ ```
49
+
50
+ For more information about the inline attribute, read:
51
+ https://doc.rust-lang.org/reference.html#inline-attributes
52
+ "## ,
53
+
54
+ E0535 : r##"
55
+ An unknown argument was given to the `inline` attribute.
56
+
57
+ Erroneous code example:
58
+
59
+ ```compile_fail,E0535
60
+ #[inline(unknown)] // error: invalid argument
61
+ pub fn something() {}
62
+
63
+ fn main() {}
64
+ ```
65
+
66
+ The `inline` attribute only supports two arguments:
67
+
68
+ * always
69
+ * never
70
+
71
+ All other arguments given to the `inline` attribute will return this error.
72
+ Example:
73
+
74
+ ```
75
+ #[inline(never)] // ok!
76
+ pub fn something() {}
77
+
78
+ fn main() {}
79
+ ```
80
+
81
+ For more information about the inline attribute, https:
82
+ read://doc.rust-lang.org/reference.html#inline-attributes
83
+ "## ,
84
+
85
+ E0536 : r##"
86
+ The `not` cfg-predicate was malformed.
87
+
88
+ Erroneous code example:
89
+
90
+ ```compile_fail,E0536
91
+ #[cfg(not())] // error: expected 1 cfg-pattern
92
+ pub fn something() {}
93
+
94
+ pub fn main() {}
95
+ ```
96
+
97
+ The `not` predicate expects one cfg-pattern. Example:
98
+
99
+ ```
100
+ #[cfg(not(target_os = "linux"))] // ok!
101
+ pub fn something() {}
102
+
103
+ pub fn main() {}
104
+ ```
105
+
106
+ For more information about the cfg attribute, read:
107
+ https://doc.rust-lang.org/reference.html#conditional-compilation
108
+ "## ,
109
+
110
+ E0537 : r##"
111
+ An unknown predicate was used inside the `cfg` attribute.
112
+
113
+ Erroneous code example:
114
+
115
+ ```compile_fail,E0537
116
+ #[cfg(unknown())] // error: invalid predicate `unknown`
117
+ pub fn something() {}
118
+
119
+ pub fn main() {}
120
+ ```
121
+
122
+ The `cfg` attribute supports only three kinds of predicates:
123
+
124
+ * any
125
+ * all
126
+ * not
127
+
128
+ Example:
129
+
130
+ ```
131
+ #[cfg(not(target_os = "linux"))] // ok!
132
+ pub fn something() {}
133
+
134
+ pub fn main() {}
135
+ ```
136
+
137
+ For more information about the cfg attribute, read:
138
+ https://doc.rust-lang.org/reference.html#conditional-compilation
139
+ "## ,
140
+
141
+ E0558 : r##"
142
+ The `export_name` attribute was malformed.
143
+
144
+ Erroneous code example:
145
+
146
+ ```compile_fail,E0558
147
+ #[export_name] // error: export_name attribute has invalid format
148
+ pub fn something() {}
149
+
150
+ fn main() {}
151
+ ```
152
+
153
+ The `export_name` attribute expects a string in order to determine the name of
154
+ the exported symbol. Example:
155
+
156
+ ```
157
+ #[export_name = "some_function"] // ok!
21
158
pub fn something() {}
22
159
23
160
fn main() {}
@@ -27,10 +164,6 @@ fn main() {}
27
164
}
28
165
29
166
register_diagnostics ! {
30
- E0534 , // expected one argument
31
- E0535 , // invalid argument
32
- E0536 , // expected 1 cfg-pattern
33
- E0537 , // invalid predicate
34
167
E0538 , // multiple [same] items
35
168
E0539 , // incorrect meta item
36
169
E0540 , // multiple rustc_deprecated attributes
0 commit comments