Skip to content

Commit 97f9cad

Browse files
committed
E0210: Add a warning about type aliases
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.
1 parent 8f36038 commit 97f9cad

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)