From 97f9cad5696b2550f1b3642e022892f0315c53c1 Mon Sep 17 00:00:00 2001 From: Marc Bowes Date: Fri, 22 Jan 2016 22:20:36 +0200 Subject: [PATCH] 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. --- src/librustc_typeck/diagnostics.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/librustc_typeck/diagnostics.rs b/src/librustc_typeck/diagnostics.rs index 55a1021f0fb94..e9e4c45581a1b 100644 --- a/src/librustc_typeck/diagnostics.rs +++ b/src/librustc_typeck/diagnostics.rs @@ -2269,6 +2269,8 @@ struct MyType(T); impl ForeignTrait for MyType { ... } // 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: