File tree Expand file tree Collapse file tree 2 files changed +42
-1
lines changed
branches/try/src/librustc_typeck Expand file tree Collapse file tree 2 files changed +42
-1
lines changed Original file line number Diff line number Diff line change 1
1
---
2
2
refs/heads/master: aca2057ed5fb7af3f8905b2bc01f72fa001c35c8
3
3
refs/heads/snap-stage3: 1af31d4974e33027a68126fa5a5a3c2c6491824f
4
- refs/heads/try: b4481e68deeffc9e6cf4648d10c51750adbb4c3b
4
+ refs/heads/try: d4c37088ca873a23e58d512d9418f59056477226
5
5
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
6
6
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
7
7
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
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
E0035 : r##"
215
256
You tried to give a type parameter where it wasn't needed. Bad example:
216
257
You can’t perform that action at this time.
0 commit comments