Skip to content

Commit 7c22c1a

Browse files
committed
Rollup merge of #31130 - marcbowes:master, r=nrc
E0210 explains about orphan rules and suggests using a local type as a workaround. It wasn't obvious to me that I couldn't use a type alias, so I added a note.
2 parents b697b3e + 97f9cad commit 7c22c1a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/librustc_typeck/diagnostics.rs

+2
Original file line numberDiff line numberDiff line change
@@ -2269,6 +2269,8 @@ struct MyType<T>(T);
22692269
impl<T> ForeignTrait for MyType<T> { ... } // Ok
22702270
```
22712271
2272+
Please note that a type alias is not sufficient.
2273+
22722274
For another example of an error, suppose there's another trait defined in `foo`
22732275
named `ForeignTrait2` that takes two type parameters. Then this `impl` results
22742276
in the same rule violation:

0 commit comments

Comments
 (0)