about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2019-11-14 13:08:23 +0100
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2019-11-14 13:08:23 +0100
commitb5b2a8984e57260bb91d3327490da74f6fa310db (patch)
treeeb7a1838dcd51f94956081823e21aec2d0e8a04f /src
parentbfa3d599ebf4be6348c2a4d6ffa8f32f61ab7c15 (diff)
downloadrust-b5b2a8984e57260bb91d3327490da74f6fa310db.tar.gz
rust-b5b2a8984e57260bb91d3327490da74f6fa310db.zip
Move E0210 to new error location
Diffstat (limited to 'src')
-rw-r--r--src/librustc_error_codes/error_codes/E0210.md23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/librustc_error_codes/error_codes/E0210.md b/src/librustc_error_codes/error_codes/E0210.md
index f8ddaecc831..dc2fd9b0ca0 100644
--- a/src/librustc_error_codes/error_codes/E0210.md
+++ b/src/librustc_error_codes/error_codes/E0210.md
@@ -1,8 +1,13 @@
 This error indicates a violation of one of Rust's orphan rules for trait
 implementations. The rule concerns the use of type parameters in an
 implementation of a foreign trait (a trait defined in another crate), and
-states that type parameters must be "covered" by a local type. To understand
-what this means, it is perhaps easiest to consider a few examples.
+states that type parameters must be "covered" by a local type.
+
+When implementing a foreign trait for a foreign type,
+the trait must have one or more type parameters.
+A type local to your crate must appear before any use of any type parameters.
+
+To understand what this means, it is perhaps easier to consider a few examples.
 
 If `ForeignTrait` is a trait defined in some external crate `foo`, then the
 following trait `impl` is an error:
@@ -60,10 +65,18 @@ impl<P1, ..., Pm> ForeignTrait<T1, ..., Tn> for T0 { ... }
 
 where `P1, ..., Pm` are the type parameters of the `impl` and `T0, ..., Tn`
 are types. One of the types `T0, ..., Tn` must be a local type (this is another
-orphan rule, see the explanation for E0117). Let `i` be the smallest integer
-such that `Ti` is a local type. Then no type parameter can appear in any of the
-`Tj` for `j < i`.
+orphan rule, see the explanation for E0117).
+
+Both of the following must be true:
+1. At least one of the types `T0..=Tn` must be a local type.
+Let `Ti` be the first such type.
+2. No uncovered type parameters `P1..=Pm` may appear in `T0..Ti`
+(excluding `Ti`).
+
+For information on the design of the orphan rules,
+see [RFC 2451] and [RFC 1023].
 
 For information on the design of the orphan rules, see [RFC 1023].
 
+[RFC 2451]: https://rust-lang.github.io/rfcs/2451-re-rebalancing-coherence.html
 [RFC 1023]: https://github.com/rust-lang/rfcs/blob/master/text/1023-rebalancing-coherence.md