File tree 1 file changed +34
-1
lines changed
1 file changed +34
-1
lines changed Original file line number Diff line number Diff line change @@ -211,6 +211,40 @@ Reference:
211
211
http://doc.rust-lang.org/reference.html#trait-objects
212
212
"## ,
213
213
214
+ E0035 : r##"
215
+ You tried to give a type parameter where it wasn't needed. Bad example:
216
+
217
+ ```
218
+ struct Test;
219
+
220
+ impl Test {
221
+ fn method(&self) {}
222
+ }
223
+
224
+ fn main() {
225
+ let x = Test;
226
+
227
+ x.method::<i32>(); // Error: Test::method doesn't need type parameter!
228
+ }
229
+ ```
230
+
231
+ To fix this error, just remove the type parameter:
232
+
233
+ ```
234
+ struct Test;
235
+
236
+ impl Test {
237
+ fn method(&self) {}
238
+ }
239
+
240
+ fn main() {
241
+ let x = Test;
242
+
243
+ x.method(); // OK, we're good!
244
+ }
245
+ ```
246
+ "## ,
247
+
214
248
E0040 : r##"
215
249
It is not allowed to manually call destructors in Rust. It is also not
216
250
necessary to do this since `drop` is called automatically whenever a value goes
@@ -1321,7 +1355,6 @@ For more information see the [opt-in builtin traits RFC](https://github.com/rust
1321
1355
1322
1356
register_diagnostics ! {
1323
1357
E0034 , // multiple applicable methods in scope
1324
- E0035 , // does not take type parameters
1325
1358
E0036 , // incorrect number of type parameters given for this method
1326
1359
E0044 , // foreign items may not have type parameters
1327
1360
E0045 , // variadic function must have C calling convention
You can’t perform that action at this time.
0 commit comments