File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -1264,7 +1264,7 @@ impl From<Foo> for i32 { // or you use a type from your crate as
1264
1264
1265
1265
E0119 : r##"
1266
1266
There are conflicting trait implementations for the same type.
1267
- Erroneous code example :
1267
+ Example of erroneous code :
1268
1268
1269
1269
```
1270
1270
trait MyTrait {
@@ -1285,7 +1285,10 @@ impl MyTrait for Foo { // error: conflicting implementations for trait
1285
1285
}
1286
1286
```
1287
1287
1288
- When you write:
1288
+ When looking for the implementation for the trait, the compiler finds
1289
+ both the `impl<T> MyTrait for T` where T is all types and the `impl
1290
+ MyTrait for Foo`. Since a trait cannot be implemented multiple times,
1291
+ this is an error. So, when you write:
1289
1292
1290
1293
```
1291
1294
impl<T> MyTrait for T {
You can’t perform that action at this time.
0 commit comments