From c745708aa31e9a54d5a6b10f810a296fe3a56376 Mon Sep 17 00:00:00 2001 From: varkor Date: Wed, 20 Mar 2019 18:32:13 +0000 Subject: [PATCH] Unify E0109, E0110 and E0111 diagnostic messages --- src/librustc_typeck/diagnostics.rs | 39 +++++++++++------------------- 1 file 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; // error: type arguments are not allowed on this entity +type X = u32; // 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::`, not `Option::::None`). +Note that generic arguments for enum variant constructors go after the variant, +not after the enum. For example, you would write `Option::None::`, +rather than `Option::::None`. "##, E0110: r##" -You tried to give a lifetime parameter to a type which doesn't need it. -Erroneous code example: +#### Note: this error code is no longer emitted by the compiler. -```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! -``` -"##, - -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##"