]> git.lizzy.rs Git - rust.git/commitdiff
Add E0128 error explanation
authorGuillaume Gomez <guillaume1.gomez@gmail.com>
Thu, 2 Jul 2015 18:11:48 +0000 (20:11 +0200)
committerGuillaume Gomez <guillaume1.gomez@gmail.com>
Sat, 4 Jul 2015 16:27:54 +0000 (18:27 +0200)
src/librustc_typeck/diagnostics.rs

index 549c89599ecd82cc955e1b60d5aabac58693c7af..01f7db83adfa1013a0e90d6dcdab497ac1fc94f3 100644 (file)
@@ -1368,6 +1368,26 @@ struct Foo {
 ```
 "##,
 
+E0128: r##"
+You declared a type parameter with a default which has the same identifier as
+the type parameter. Erroneous code example:
+
+```
+pub struct Foo<SomeType=SomeType>;
+// error: type parameters with a default cannot use forward declared
+// identifiers
+```
+
+Please verify you used the good type or change the type parameter identifier.
+Example:
+
+```
+pub struct Foo<T=SomeType> {
+    value: T
+}
+```
+"##,
+
 E0131: r##"
 It is not possible to define `main` with type parameters, or even with function
 parameters. When `main` is present, it must take no arguments and return `()`.
@@ -1978,7 +1998,6 @@ impl Baz for Bar { } // Note: This is OK
     E0122,
     E0123,
     E0127,
-    E0128,
     E0129,
     E0130,
     E0141,