File tree 1 file changed +41
-1
lines changed
1 file changed +41
-1
lines changed Original file line number Diff line number Diff line change @@ -211,6 +211,47 @@ Reference:
211
211
http://doc.rust-lang.org/reference.html#trait-objects
212
212
"## ,
213
213
214
+ E0034 : r##"
215
+ The compiler doesn't know what method to call because more than one does
216
+ have the same prototype. Example:
217
+
218
+ ```
219
+ struct Test;
220
+
221
+ trait Trait1 {
222
+ fn foo();
223
+ }
224
+
225
+ trait Trait2 {
226
+ fn foo();
227
+ }
228
+
229
+ impl Trait1 for Test { fn foo() {} }
230
+ impl Trait2 for Test { fn foo() {} }
231
+
232
+ fn main() {
233
+ Test::foo() // error, what foo() to call?
234
+ }
235
+ ```
236
+
237
+ To avoid this error, you have to keep only one of them and remove the others.
238
+ So let's take our example and fix it:
239
+
240
+ ```
241
+ struct Test;
242
+
243
+ trait Trait1 {
244
+ fn foo();
245
+ }
246
+
247
+ impl Trait1 for Test { fn foo() {} }
248
+
249
+ fn main() {
250
+ Test::foo() // and now that's good!
251
+ }
252
+ ```
253
+ "## ,
254
+
214
255
E0040 : r##"
215
256
It is not allowed to manually call destructors in Rust. It is also not
216
257
necessary to do this since `drop` is called automatically whenever a value goes
@@ -1320,7 +1361,6 @@ For more information see the [opt-in builtin traits RFC](https://github.com/rust
1320
1361
}
1321
1362
1322
1363
register_diagnostics ! {
1323
- E0034 , // multiple applicable methods in scope
1324
1364
E0035 , // does not take type parameters
1325
1365
E0036 , // incorrect number of type parameters given for this method
1326
1366
E0044 , // foreign items may not have type parameters
You can’t perform that action at this time.
0 commit comments