Skip to content

Commit d3dc1e5

Browse files
committed
Rollup merge of #27350 - GuillaumeGomez:patch-1, r=Manishearth
cc #26970. r? @Manishearth
2 parents c0d21cf + cf55db2 commit d3dc1e5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/librustc_typeck/diagnostics.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1264,7 +1264,7 @@ impl From<Foo> for i32 { // or you use a type from your crate as
12641264

12651265
E0119: r##"
12661266
There are conflicting trait implementations for the same type.
1267-
Erroneous code example:
1267+
Example of erroneous code:
12681268
12691269
```
12701270
trait 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
```
12911294
impl<T> MyTrait for T {

0 commit comments

Comments
 (0)