]> git.lizzy.rs Git - rust.git/commitdiff
Add E0110 error explanation
authorGuillaume Gomez <guillaume1.gomez@gmail.com>
Sat, 27 Jun 2015 22:20:59 +0000 (00:20 +0200)
committerGuillaume Gomez <guillaume1.gomez@gmail.com>
Mon, 29 Jun 2015 05:36:59 +0000 (07:36 +0200)
src/librustc/diagnostics.rs
src/librustc_typeck/diagnostics.rs

index b15bcb7b75862c7a115d0560db0373652e53625c..8d51674ab13e5154b5b1e078167cb8a45d714bd3 100644 (file)
@@ -361,13 +361,31 @@ enum Enum {
 "##,
 
 E0109: r##"
-You tried to give type parameter to a type which doesn't need it. Erroneous
+You tried to give    type parameter to a type which doesn't need it. Erroneous
 code example:
 
 ```
 type X = u32<i32>; // error: type parameters are not allowed on this type
 ```
 
+Please check that you used the correct type and recheck its definition. Perhaps
+it doesn't need the type parameter.
+Example:
+
+```
+type X = u32; // ok!
+```
+"##,
+
+E0110: r##"
+You tried to give a lifetime parameter to a type which doesn't need it.
+Erroneous code example:
+
+```
+type X = u32<'static>; // error: lifetime parameters are not allowed on
+                       //        this type
+```
+
 Please check you actually used the good type or check again its definition.
 Example:
 
@@ -1071,7 +1089,6 @@ fn bar(&self) -> i32 { self.0 }
     E0017,
     E0022,
     E0038,
-    E0110,
     E0134,
     E0135,
     E0136,
index bf2913c83a15254fb1e6b5cec61f0ba587205648..d4977c5d3941c27dea7ad48d6f0b07740ad9bdcf 100644 (file)
@@ -1010,12 +1010,15 @@ fn main() {
 
 ```
 type Foo<T> = u32; // error: type parameter `T` is unused
+// or:
+type Foo<A,B> = Box<A>; // error: type parameter `B` is unused
 ```
 
 Please check you didn't write too many type parameters. Example:
 
 ```
 type Foo = u32; // ok!
+type Foo<A> = Box<A>; // ok!
 ```
 "##,