about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2015-06-30 12:12:45 +0200
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2015-06-30 19:21:45 +0200
commit2881e83c96c6f35fdc6741bbb3f951507ef74ca5 (patch)
tree6c553ca73bdd5b6ef99f4c36a81df98a10f3fad3
parenta481c4ecdc95bf9247f262334f288ff78001ff6c (diff)
downloadrust-2881e83c96c6f35fdc6741bbb3f951507ef74ca5.tar.gz
rust-2881e83c96c6f35fdc6741bbb3f951507ef74ca5.zip
Add E0207 error explanation
-rw-r--r--src/librustc_typeck/diagnostics.rs37
1 files changed, 36 insertions, 1 deletions
diff --git a/src/librustc_typeck/diagnostics.rs b/src/librustc_typeck/diagnostics.rs
index 7cc13a1a077..83e6ea74d83 100644
--- a/src/librustc_typeck/diagnostics.rs
+++ b/src/librustc_typeck/diagnostics.rs
@@ -1600,6 +1600,42 @@ impl Copy for &'static Bar { } // error
 ```
 "##,
 
+E0207: r##"
+You passed an unused type parameter when implementing a trait
+on an object. Erroneous code example:
+
+```
+trait MyTrait {
+    fn get(&self) -> usize;
+}
+
+struct Foo;
+
+impl<T> MyTrait for Foo {
+    fn get(&self) -> usize {
+        0
+    }
+}
+```
+
+Please check your object definition and remove unused type
+parameter(s). Example:
+
+```
+trait MyTrait {
+    fn get(&self) -> usize;
+}
+
+struct Foo;
+
+impl MyTrait for Foo {
+    fn get(&self) -> usize {
+        0
+    }
+}
+```
+"##,
+
 E0211: r##"
 You used an intrinsic function which doesn't correspond to its
 definition. Erroneous code example:
@@ -1878,7 +1914,6 @@ register_diagnostics! {
     E0196, // cannot determine a type for this closure
     E0203, // type parameter has more than one relaxed default bound,
            // and only one is supported
-    E0207, // type parameter is not constrained by the impl trait, self type, or predicate
     E0208,
     E0209, // builtin traits can only be implemented on structs or enums
     E0210, // type parameter is not constrained by any local type