about summary refs log tree commit diff
diff options
context:
space:
mode:
authorvarkor <github@varkor.com>2019-03-20 18:32:13 +0000
committervarkor <github@varkor.com>2019-03-20 18:32:13 +0000
commitc745708aa31e9a54d5a6b10f810a296fe3a56376 (patch)
tree70dbc2a0759f91e28816e7aafb6a56b2f1c4d06a
parent7a4df3b53da369110984a2b57419c05a53e33b38 (diff)
Unify E0109, E0110 and E0111 diagnostic messages
-rw-r--r--src/librustc_typeck/diagnostics.rs39
1 files changed, 14 insertions, 25 deletions
diff --git a/src/librustc_typeck/diagnostics.rs b/src/librustc_typeck/diagnostics.rs
index 399cd6f890c..cde37fb23c3 100644
--- a/src/librustc_typeck/diagnostics.rs
+++ b/src/librustc_typeck/diagnostics.rs
@@ -1290,45 +1290,34 @@ fn main() {
 "##,
 
 E0109: r##"
-You tried to give a type parameter to a type which doesn't need it. Erroneous
-code example:
+You tried to provide a generic argument to a type which doesn't need it.
+Erroneous code example:
 
 ```compile_fail,E0109
-type X = u32<i32>; // error: type arguments are not allowed on this entity
+type X = u32<i32>; // error: type arguments are not allowed for this type
+type Y = bool<'static>; // error: lifetime 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.
+Check that you used the correct argument and that the definition is correct.
 
 Example:
 
 ```
-type X = u32; // this compiles
+type X = u32; // ok!
+type Y = bool; // ok!
 ```
 
-Note that type parameters for enum-variant constructors go after the variant,
-not after the enum (`Option::None::<u32>`, not `Option::<u32>::None`).
+Note that generic arguments for enum variant constructors go after the variant,
+not after the enum. For example, you would write `Option::None::<u32>`,
+rather than `Option::<u32>::None`.
 "##,
 
 E0110: r##"
-You tried to give a lifetime parameter to a type which doesn't need it.
-Erroneous code example:
-
-```compile_fail,E0110
-type X = u32<'static>; // error: lifetime parameters are not allowed on
-                       //        this type
-```
-
-Please check that the correct type was used and recheck its definition; perhaps
-it doesn't need the lifetime parameter. Example:
-
-```
-type X = u32; // ok!
-```
-"##,
+#### Note: this error code is no longer emitted by the compiler.
 
-E0111: r##"
-You tried to give a const parameter to a type which doesn't need it.
+You tried to provide a lifetime to a type which doesn't need it.
+See `E0109` for more details.
 "##,
 
 E0116: r##"