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
12641264
12651265E0119 : r##"
12661266There are conflicting trait implementations for the same type.
1267- Erroneous code example :
1267+ Example of erroneous code :
12681268
12691269```
12701270trait MyTrait {
@@ -1285,7 +1285,10 @@ impl MyTrait for Foo { // error: conflicting implementations for trait
12851285}
12861286```
12871287
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:
12891292
12901293```
12911294impl<T> MyTrait for T {
You can’t perform that action at this time.
0 commit comments