Skip to content

Commit

Permalink
E0210: Add a warning about type aliases
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
marcbowes committed Jan 22, 2016
1 parent 8f36038 commit 97f9cad
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/librustc_typeck/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2269,6 +2269,8 @@ struct MyType<T>(T);
impl<T> ForeignTrait for MyType<T> { ... } // Ok
```
Please note that a type alias is not sufficient.
For another example of an error, suppose there's another trait defined in `foo`
named `ForeignTrait2` that takes two type parameters. Then this `impl` results
in the same rule violation:
Expand Down

0 comments on commit 97f9cad

Please sign in to comment.