From c745708aa31e9a54d5a6b10f810a296fe3a56376 Mon Sep 17 00:00:00 2001 From: varkor Date: Wed, 20 Mar 2019 18:32:13 +0000 Subject: [PATCH 1/3] 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 399cd6f890c25..cde37fb23c320 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: - -```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##" From 4900585a4f15f93bb466f8c194445a0e9e628d49 Mon Sep 17 00:00:00 2001 From: varkor Date: Wed, 20 Mar 2019 18:32:30 +0000 Subject: [PATCH 2/3] Unify E0109, E0110 and E0111 errors --- src/librustc_typeck/astconv.rs | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/src/librustc_typeck/astconv.rs b/src/librustc_typeck/astconv.rs index df8b1bcfe706e..c65f3443fbb54 100644 --- a/src/librustc_typeck/astconv.rs +++ b/src/librustc_typeck/astconv.rs @@ -1486,37 +1486,34 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx> + 'o { segment.with_generic_args(|generic_args| { let (mut err_for_lt, mut err_for_ty, mut err_for_ct) = (false, false, false); for arg in &generic_args.args { - let (mut span_err, span, kind) = match arg { - // FIXME(varkor): unify E0109, E0110 and E0111. + let (span, kind) = match arg { hir::GenericArg::Lifetime(lt) => { if err_for_lt { continue } err_for_lt = true; has_err = true; - (struct_span_err!(self.tcx().sess, lt.span, E0110, - "lifetime arguments are not allowed on this entity"), - lt.span, - "lifetime") + (lt.span, "lifetime") } hir::GenericArg::Type(ty) => { if err_for_ty { continue } err_for_ty = true; has_err = true; - (struct_span_err!(self.tcx().sess, ty.span, E0109, - "type arguments are not allowed on this entity"), - ty.span, - "type") + (ty.span, "type") } hir::GenericArg::Const(ct) => { if err_for_ct { continue } err_for_ct = true; - (struct_span_err!(self.tcx().sess, ct.span, E0111, - "const parameters are not allowed on this type"), - ct.span, - "const") + (ct.span, "const") } }; - span_err.span_label(span, format!("{} argument not allowed", kind)) - .emit(); + let mut err = struct_span_err!( + self.tcx().sess, + span, + E0109, + "{} arguments are not allowed for this type", + kind, + ); + err.span_label(span, format!("{} argument not allowed", kind)); + err.emit(); if err_for_lt && err_for_ty && err_for_ct { break; } From aff175b328d8d35969e5a76aa0fff4d6c4a5d262 Mon Sep 17 00:00:00 2001 From: varkor Date: Wed, 20 Mar 2019 18:32:52 +0000 Subject: [PATCH 3/3] Update tests --- src/test/ui/enum-variant-generic-args.rs | 36 +++++++------- src/test/ui/enum-variant-generic-args.stderr | 36 +++++++------- src/test/ui/error-codes/E0109.stderr | 2 +- src/test/ui/error-codes/E0110.rs | 2 +- src/test/ui/error-codes/E0110.stderr | 4 +- src/test/ui/issues/issue-22706.rs | 2 +- src/test/ui/issues/issue-22706.stderr | 2 +- src/test/ui/mod-subitem-as-enum-variant.rs | 2 +- .../ui/mod-subitem-as-enum-variant.stderr | 2 +- src/test/ui/prim-with-args.rs | 44 ++++++++--------- src/test/ui/prim-with-args.stderr | 47 +++++++++---------- .../ui/qualified/qualified-path-params-2.rs | 2 +- .../qualified/qualified-path-params-2.stderr | 2 +- .../collections.rs | 12 ++--- .../collections.stderr | 13 +++-- .../construct_with_other_type.rs | 8 ++-- .../construct_with_other_type.stderr | 8 ++-- ...ic_associated_type_undeclared_lifetimes.rs | 8 ++-- ...ssociated_type_undeclared_lifetimes.stderr | 10 ++-- .../iterable.rs | 14 +++--- .../iterable.stderr | 14 +++--- .../parameter_number_and_kind.rs | 12 ++--- .../parameter_number_and_kind.stderr | 13 +++-- .../pointer_family.rs | 8 ++-- .../pointer_family.stderr | 8 ++-- .../streaming_iterator.rs | 10 ++-- .../streaming_iterator.stderr | 12 ++--- .../ui/structs/struct-path-associated-type.rs | 6 +-- .../struct-path-associated-type.stderr | 6 +-- src/test/ui/structs/struct-path-self.rs | 6 +-- src/test/ui/structs/struct-path-self.stderr | 6 +-- src/test/ui/type-alias-enum-variants.rs | 2 +- src/test/ui/type-alias-enum-variants.stderr | 2 +- 33 files changed, 179 insertions(+), 182 deletions(-) diff --git a/src/test/ui/enum-variant-generic-args.rs b/src/test/ui/enum-variant-generic-args.rs index 6eddd70964546..dd1f5f334df1d 100644 --- a/src/test/ui/enum-variant-generic-args.rs +++ b/src/test/ui/enum-variant-generic-args.rs @@ -9,27 +9,27 @@ impl Enum { Self::TSVariant(()); //~^ ERROR mismatched types [E0308] Self::TSVariant::<()>(()); - //~^ ERROR type arguments are not allowed on this entity [E0109] + //~^ ERROR type arguments are not allowed for this type [E0109] Self::<()>::TSVariant(()); - //~^ ERROR type arguments are not allowed on this entity [E0109] + //~^ ERROR type arguments are not allowed for this type [E0109] //~^^ ERROR mismatched types [E0308] Self::<()>::TSVariant::<()>(()); - //~^ ERROR type arguments are not allowed on this entity [E0109] - //~^^ ERROR type arguments are not allowed on this entity [E0109] + //~^ ERROR type arguments are not allowed for this type [E0109] + //~^^ ERROR type arguments are not allowed for this type [E0109] } fn s_variant() { Self::SVariant { v: () }; //~^ ERROR mismatched types [E0308] Self::SVariant::<()> { v: () }; - //~^ ERROR type arguments are not allowed on this entity [E0109] + //~^ ERROR type arguments are not allowed for this type [E0109] //~^^ ERROR mismatched types [E0308] Self::<()>::SVariant { v: () }; - //~^ ERROR type arguments are not allowed on this entity [E0109] + //~^ ERROR type arguments are not allowed for this type [E0109] //~^^ ERROR mismatched types [E0308] Self::<()>::SVariant::<()> { v: () }; - //~^ ERROR type arguments are not allowed on this entity [E0109] - //~^^ ERROR type arguments are not allowed on this entity [E0109] + //~^ ERROR type arguments are not allowed for this type [E0109] + //~^^ ERROR type arguments are not allowed for this type [E0109] //~^^^ ERROR mismatched types [E0308] } } @@ -38,36 +38,36 @@ fn main() { // Tuple struct variant Enum::<()>::TSVariant::<()>(()); - //~^ ERROR type arguments are not allowed on this entity [E0109] + //~^ ERROR type arguments are not allowed for this type [E0109] Alias::TSVariant::<()>(()); - //~^ ERROR type arguments are not allowed on this entity [E0109] + //~^ ERROR type arguments are not allowed for this type [E0109] Alias::<()>::TSVariant::<()>(()); - //~^ ERROR type arguments are not allowed on this entity [E0109] + //~^ ERROR type arguments are not allowed for this type [E0109] AliasFixed::TSVariant::<()>(()); - //~^ ERROR type arguments are not allowed on this entity [E0109] + //~^ ERROR type arguments are not allowed for this type [E0109] AliasFixed::<()>::TSVariant(()); //~^ ERROR wrong number of type arguments: expected 0, found 1 [E0107] AliasFixed::<()>::TSVariant::<()>(()); - //~^ ERROR type arguments are not allowed on this entity [E0109] + //~^ ERROR type arguments are not allowed for this type [E0109] //~^^ ERROR wrong number of type arguments: expected 0, found 1 [E0107] // Struct variant Enum::<()>::SVariant::<()> { v: () }; - //~^ ERROR type arguments are not allowed on this entity [E0109] + //~^ ERROR type arguments are not allowed for this type [E0109] Alias::SVariant::<()> { v: () }; - //~^ ERROR type arguments are not allowed on this entity [E0109] + //~^ ERROR type arguments are not allowed for this type [E0109] Alias::<()>::SVariant::<()> { v: () }; - //~^ ERROR type arguments are not allowed on this entity [E0109] + //~^ ERROR type arguments are not allowed for this type [E0109] AliasFixed::SVariant::<()> { v: () }; - //~^ ERROR type arguments are not allowed on this entity [E0109] + //~^ ERROR type arguments are not allowed for this type [E0109] AliasFixed::<()>::SVariant { v: () }; //~^ ERROR wrong number of type arguments: expected 0, found 1 [E0107] AliasFixed::<()>::SVariant::<()> { v: () }; - //~^ ERROR type arguments are not allowed on this entity [E0109] + //~^ ERROR type arguments are not allowed for this type [E0109] //~^^ ERROR wrong number of type arguments: expected 0, found 1 [E0107] } diff --git a/src/test/ui/enum-variant-generic-args.stderr b/src/test/ui/enum-variant-generic-args.stderr index 4d3b576734643..09b9a4eed6be8 100644 --- a/src/test/ui/enum-variant-generic-args.stderr +++ b/src/test/ui/enum-variant-generic-args.stderr @@ -7,13 +7,13 @@ LL | Self::TSVariant(()); = note: expected type `T` found type `()` -error[E0109]: type arguments are not allowed on this entity +error[E0109]: type arguments are not allowed for this type --> $DIR/enum-variant-generic-args.rs:11:27 | LL | Self::TSVariant::<()>(()); | ^^ type argument not allowed -error[E0109]: type arguments are not allowed on this entity +error[E0109]: type arguments are not allowed for this type --> $DIR/enum-variant-generic-args.rs:13:16 | LL | Self::<()>::TSVariant(()); @@ -28,13 +28,13 @@ LL | Self::<()>::TSVariant(()); = note: expected type `T` found type `()` -error[E0109]: type arguments are not allowed on this entity +error[E0109]: type arguments are not allowed for this type --> $DIR/enum-variant-generic-args.rs:16:16 | LL | Self::<()>::TSVariant::<()>(()); | ^^ type argument not allowed -error[E0109]: type arguments are not allowed on this entity +error[E0109]: type arguments are not allowed for this type --> $DIR/enum-variant-generic-args.rs:16:33 | LL | Self::<()>::TSVariant::<()>(()); @@ -49,7 +49,7 @@ LL | Self::SVariant { v: () }; = note: expected type `T` found type `()` -error[E0109]: type arguments are not allowed on this entity +error[E0109]: type arguments are not allowed for this type --> $DIR/enum-variant-generic-args.rs:24:26 | LL | Self::SVariant::<()> { v: () }; @@ -64,7 +64,7 @@ LL | Self::SVariant::<()> { v: () }; = note: expected type `T` found type `()` -error[E0109]: type arguments are not allowed on this entity +error[E0109]: type arguments are not allowed for this type --> $DIR/enum-variant-generic-args.rs:27:16 | LL | Self::<()>::SVariant { v: () }; @@ -79,13 +79,13 @@ LL | Self::<()>::SVariant { v: () }; = note: expected type `T` found type `()` -error[E0109]: type arguments are not allowed on this entity +error[E0109]: type arguments are not allowed for this type --> $DIR/enum-variant-generic-args.rs:30:16 | LL | Self::<()>::SVariant::<()> { v: () }; | ^^ type argument not allowed -error[E0109]: type arguments are not allowed on this entity +error[E0109]: type arguments are not allowed for this type --> $DIR/enum-variant-generic-args.rs:30:32 | LL | Self::<()>::SVariant::<()> { v: () }; @@ -100,25 +100,25 @@ LL | Self::<()>::SVariant::<()> { v: () }; = note: expected type `T` found type `()` -error[E0109]: type arguments are not allowed on this entity +error[E0109]: type arguments are not allowed for this type --> $DIR/enum-variant-generic-args.rs:40:29 | LL | Enum::<()>::TSVariant::<()>(()); | ^^ type argument not allowed -error[E0109]: type arguments are not allowed on this entity +error[E0109]: type arguments are not allowed for this type --> $DIR/enum-variant-generic-args.rs:43:24 | LL | Alias::TSVariant::<()>(()); | ^^ type argument not allowed -error[E0109]: type arguments are not allowed on this entity +error[E0109]: type arguments are not allowed for this type --> $DIR/enum-variant-generic-args.rs:45:30 | LL | Alias::<()>::TSVariant::<()>(()); | ^^ type argument not allowed -error[E0109]: type arguments are not allowed on this entity +error[E0109]: type arguments are not allowed for this type --> $DIR/enum-variant-generic-args.rs:48:29 | LL | AliasFixed::TSVariant::<()>(()); @@ -136,31 +136,31 @@ error[E0107]: wrong number of type arguments: expected 0, found 1 LL | AliasFixed::<()>::TSVariant::<()>(()); | ^^ unexpected type argument -error[E0109]: type arguments are not allowed on this entity +error[E0109]: type arguments are not allowed for this type --> $DIR/enum-variant-generic-args.rs:52:35 | LL | AliasFixed::<()>::TSVariant::<()>(()); | ^^ type argument not allowed -error[E0109]: type arguments are not allowed on this entity +error[E0109]: type arguments are not allowed for this type --> $DIR/enum-variant-generic-args.rs:58:28 | LL | Enum::<()>::SVariant::<()> { v: () }; | ^^ type argument not allowed -error[E0109]: type arguments are not allowed on this entity +error[E0109]: type arguments are not allowed for this type --> $DIR/enum-variant-generic-args.rs:61:23 | LL | Alias::SVariant::<()> { v: () }; | ^^ type argument not allowed -error[E0109]: type arguments are not allowed on this entity +error[E0109]: type arguments are not allowed for this type --> $DIR/enum-variant-generic-args.rs:63:29 | LL | Alias::<()>::SVariant::<()> { v: () }; | ^^ type argument not allowed -error[E0109]: type arguments are not allowed on this entity +error[E0109]: type arguments are not allowed for this type --> $DIR/enum-variant-generic-args.rs:66:28 | LL | AliasFixed::SVariant::<()> { v: () }; @@ -178,7 +178,7 @@ error[E0107]: wrong number of type arguments: expected 0, found 1 LL | AliasFixed::<()>::SVariant::<()> { v: () }; | ^^ unexpected type argument -error[E0109]: type arguments are not allowed on this entity +error[E0109]: type arguments are not allowed for this type --> $DIR/enum-variant-generic-args.rs:70:34 | LL | AliasFixed::<()>::SVariant::<()> { v: () }; diff --git a/src/test/ui/error-codes/E0109.stderr b/src/test/ui/error-codes/E0109.stderr index a807f2d44a6fe..577e286fcc6ce 100644 --- a/src/test/ui/error-codes/E0109.stderr +++ b/src/test/ui/error-codes/E0109.stderr @@ -1,4 +1,4 @@ -error[E0109]: type arguments are not allowed on this entity +error[E0109]: type arguments are not allowed for this type --> $DIR/E0109.rs:1:14 | LL | type X = u32; diff --git a/src/test/ui/error-codes/E0110.rs b/src/test/ui/error-codes/E0110.rs index 764b62b8dfecf..314c7f5af6036 100644 --- a/src/test/ui/error-codes/E0110.rs +++ b/src/test/ui/error-codes/E0110.rs @@ -1,3 +1,3 @@ -type X = u32<'static>; //~ ERROR E0110 +type X = u32<'static>; //~ ERROR E0109 fn main() {} diff --git a/src/test/ui/error-codes/E0110.stderr b/src/test/ui/error-codes/E0110.stderr index 3bc4775bdc12f..b022131808738 100644 --- a/src/test/ui/error-codes/E0110.stderr +++ b/src/test/ui/error-codes/E0110.stderr @@ -1,4 +1,4 @@ -error[E0110]: lifetime arguments are not allowed on this entity +error[E0109]: lifetime arguments are not allowed for this type --> $DIR/E0110.rs:1:14 | LL | type X = u32<'static>; @@ -6,4 +6,4 @@ LL | type X = u32<'static>; error: aborting due to previous error -For more information about this error, try `rustc --explain E0110`. +For more information about this error, try `rustc --explain E0109`. diff --git a/src/test/ui/issues/issue-22706.rs b/src/test/ui/issues/issue-22706.rs index 413a0d9a4943a..28e8a72280481 100644 --- a/src/test/ui/issues/issue-22706.rs +++ b/src/test/ui/issues/issue-22706.rs @@ -1,3 +1,3 @@ fn is_copy::Copy>() {} -//~^ ERROR type arguments are not allowed on this entity [E0109] +//~^ ERROR type arguments are not allowed for this type [E0109] fn main() {} diff --git a/src/test/ui/issues/issue-22706.stderr b/src/test/ui/issues/issue-22706.stderr index a3cf716903d20..c5929397f6501 100644 --- a/src/test/ui/issues/issue-22706.stderr +++ b/src/test/ui/issues/issue-22706.stderr @@ -1,4 +1,4 @@ -error[E0109]: type arguments are not allowed on this entity +error[E0109]: type arguments are not allowed for this type --> $DIR/issue-22706.rs:1:29 | LL | fn is_copy::Copy>() {} diff --git a/src/test/ui/mod-subitem-as-enum-variant.rs b/src/test/ui/mod-subitem-as-enum-variant.rs index ec809d44e942a..cd4459ae0ff42 100644 --- a/src/test/ui/mod-subitem-as-enum-variant.rs +++ b/src/test/ui/mod-subitem-as-enum-variant.rs @@ -6,5 +6,5 @@ mod Mod { fn main() { Mod::FakeVariant::(0); Mod::::FakeVariant(0); - //~^ ERROR type arguments are not allowed on this entity [E0109] + //~^ ERROR type arguments are not allowed for this type [E0109] } diff --git a/src/test/ui/mod-subitem-as-enum-variant.stderr b/src/test/ui/mod-subitem-as-enum-variant.stderr index d62bad81c3d8d..72eca588208bb 100644 --- a/src/test/ui/mod-subitem-as-enum-variant.stderr +++ b/src/test/ui/mod-subitem-as-enum-variant.stderr @@ -1,4 +1,4 @@ -error[E0109]: type arguments are not allowed on this entity +error[E0109]: type arguments are not allowed for this type --> $DIR/mod-subitem-as-enum-variant.rs:8:11 | LL | Mod::::FakeVariant(0); diff --git a/src/test/ui/prim-with-args.rs b/src/test/ui/prim-with-args.rs index b5df0fb76ca6a..e5beaca6abb8c 100644 --- a/src/test/ui/prim-with-args.rs +++ b/src/test/ui/prim-with-args.rs @@ -1,27 +1,27 @@ fn main() { -let x: isize; //~ ERROR type arguments are not allowed on this entity -let x: i8; //~ ERROR type arguments are not allowed on this entity -let x: i16; //~ ERROR type arguments are not allowed on this entity -let x: i32; //~ ERROR type arguments are not allowed on this entity -let x: i64; //~ ERROR type arguments are not allowed on this entity -let x: usize; //~ ERROR type arguments are not allowed on this entity -let x: u8; //~ ERROR type arguments are not allowed on this entity -let x: u16; //~ ERROR type arguments are not allowed on this entity -let x: u32; //~ ERROR type arguments are not allowed on this entity -let x: u64; //~ ERROR type arguments are not allowed on this entity -let x: char; //~ ERROR type arguments are not allowed on this entity +let x: isize; //~ ERROR type arguments are not allowed for this type +let x: i8; //~ ERROR type arguments are not allowed for this type +let x: i16; //~ ERROR type arguments are not allowed for this type +let x: i32; //~ ERROR type arguments are not allowed for this type +let x: i64; //~ ERROR type arguments are not allowed for this type +let x: usize; //~ ERROR type arguments are not allowed for this type +let x: u8; //~ ERROR type arguments are not allowed for this type +let x: u16; //~ ERROR type arguments are not allowed for this type +let x: u32; //~ ERROR type arguments are not allowed for this type +let x: u64; //~ ERROR type arguments are not allowed for this type +let x: char; //~ ERROR type arguments are not allowed for this type -let x: isize<'static>; //~ ERROR lifetime arguments are not allowed on this entity -let x: i8<'static>; //~ ERROR lifetime arguments are not allowed on this entity -let x: i16<'static>; //~ ERROR lifetime arguments are not allowed on this entity -let x: i32<'static>; //~ ERROR lifetime arguments are not allowed on this entity -let x: i64<'static>; //~ ERROR lifetime arguments are not allowed on this entity -let x: usize<'static>; //~ ERROR lifetime arguments are not allowed on this entity -let x: u8<'static>; //~ ERROR lifetime arguments are not allowed on this entity -let x: u16<'static>; //~ ERROR lifetime arguments are not allowed on this entity -let x: u32<'static>; //~ ERROR lifetime arguments are not allowed on this entity -let x: u64<'static>; //~ ERROR lifetime arguments are not allowed on this entity -let x: char<'static>; //~ ERROR lifetime arguments are not allowed on this entity +let x: isize<'static>; //~ ERROR lifetime arguments are not allowed for this type +let x: i8<'static>; //~ ERROR lifetime arguments are not allowed for this type +let x: i16<'static>; //~ ERROR lifetime arguments are not allowed for this type +let x: i32<'static>; //~ ERROR lifetime arguments are not allowed for this type +let x: i64<'static>; //~ ERROR lifetime arguments are not allowed for this type +let x: usize<'static>; //~ ERROR lifetime arguments are not allowed for this type +let x: u8<'static>; //~ ERROR lifetime arguments are not allowed for this type +let x: u16<'static>; //~ ERROR lifetime arguments are not allowed for this type +let x: u32<'static>; //~ ERROR lifetime arguments are not allowed for this type +let x: u64<'static>; //~ ERROR lifetime arguments are not allowed for this type +let x: char<'static>; //~ ERROR lifetime arguments are not allowed for this type } diff --git a/src/test/ui/prim-with-args.stderr b/src/test/ui/prim-with-args.stderr index 4535633bc6f31..4bde981e7f2d4 100644 --- a/src/test/ui/prim-with-args.stderr +++ b/src/test/ui/prim-with-args.stderr @@ -1,130 +1,130 @@ -error[E0109]: type arguments are not allowed on this entity +error[E0109]: type arguments are not allowed for this type --> $DIR/prim-with-args.rs:3:14 | LL | let x: isize; | ^^^^^ type argument not allowed -error[E0109]: type arguments are not allowed on this entity +error[E0109]: type arguments are not allowed for this type --> $DIR/prim-with-args.rs:4:11 | LL | let x: i8; | ^^^^^ type argument not allowed -error[E0109]: type arguments are not allowed on this entity +error[E0109]: type arguments are not allowed for this type --> $DIR/prim-with-args.rs:5:12 | LL | let x: i16; | ^^^^^ type argument not allowed -error[E0109]: type arguments are not allowed on this entity +error[E0109]: type arguments are not allowed for this type --> $DIR/prim-with-args.rs:6:12 | LL | let x: i32; | ^^^^^ type argument not allowed -error[E0109]: type arguments are not allowed on this entity +error[E0109]: type arguments are not allowed for this type --> $DIR/prim-with-args.rs:7:12 | LL | let x: i64; | ^^^^^ type argument not allowed -error[E0109]: type arguments are not allowed on this entity +error[E0109]: type arguments are not allowed for this type --> $DIR/prim-with-args.rs:8:14 | LL | let x: usize; | ^^^^^ type argument not allowed -error[E0109]: type arguments are not allowed on this entity +error[E0109]: type arguments are not allowed for this type --> $DIR/prim-with-args.rs:9:11 | LL | let x: u8; | ^^^^^ type argument not allowed -error[E0109]: type arguments are not allowed on this entity +error[E0109]: type arguments are not allowed for this type --> $DIR/prim-with-args.rs:10:12 | LL | let x: u16; | ^^^^^ type argument not allowed -error[E0109]: type arguments are not allowed on this entity +error[E0109]: type arguments are not allowed for this type --> $DIR/prim-with-args.rs:11:12 | LL | let x: u32; | ^^^^^ type argument not allowed -error[E0109]: type arguments are not allowed on this entity +error[E0109]: type arguments are not allowed for this type --> $DIR/prim-with-args.rs:12:12 | LL | let x: u64; | ^^^^^ type argument not allowed -error[E0109]: type arguments are not allowed on this entity +error[E0109]: type arguments are not allowed for this type --> $DIR/prim-with-args.rs:13:13 | LL | let x: char; | ^^^^^ type argument not allowed -error[E0110]: lifetime arguments are not allowed on this entity +error[E0109]: lifetime arguments are not allowed for this type --> $DIR/prim-with-args.rs:15:14 | LL | let x: isize<'static>; | ^^^^^^^ lifetime argument not allowed -error[E0110]: lifetime arguments are not allowed on this entity +error[E0109]: lifetime arguments are not allowed for this type --> $DIR/prim-with-args.rs:16:11 | LL | let x: i8<'static>; | ^^^^^^^ lifetime argument not allowed -error[E0110]: lifetime arguments are not allowed on this entity +error[E0109]: lifetime arguments are not allowed for this type --> $DIR/prim-with-args.rs:17:12 | LL | let x: i16<'static>; | ^^^^^^^ lifetime argument not allowed -error[E0110]: lifetime arguments are not allowed on this entity +error[E0109]: lifetime arguments are not allowed for this type --> $DIR/prim-with-args.rs:18:12 | LL | let x: i32<'static>; | ^^^^^^^ lifetime argument not allowed -error[E0110]: lifetime arguments are not allowed on this entity +error[E0109]: lifetime arguments are not allowed for this type --> $DIR/prim-with-args.rs:19:12 | LL | let x: i64<'static>; | ^^^^^^^ lifetime argument not allowed -error[E0110]: lifetime arguments are not allowed on this entity +error[E0109]: lifetime arguments are not allowed for this type --> $DIR/prim-with-args.rs:20:14 | LL | let x: usize<'static>; | ^^^^^^^ lifetime argument not allowed -error[E0110]: lifetime arguments are not allowed on this entity +error[E0109]: lifetime arguments are not allowed for this type --> $DIR/prim-with-args.rs:21:11 | LL | let x: u8<'static>; | ^^^^^^^ lifetime argument not allowed -error[E0110]: lifetime arguments are not allowed on this entity +error[E0109]: lifetime arguments are not allowed for this type --> $DIR/prim-with-args.rs:22:12 | LL | let x: u16<'static>; | ^^^^^^^ lifetime argument not allowed -error[E0110]: lifetime arguments are not allowed on this entity +error[E0109]: lifetime arguments are not allowed for this type --> $DIR/prim-with-args.rs:23:12 | LL | let x: u32<'static>; | ^^^^^^^ lifetime argument not allowed -error[E0110]: lifetime arguments are not allowed on this entity +error[E0109]: lifetime arguments are not allowed for this type --> $DIR/prim-with-args.rs:24:12 | LL | let x: u64<'static>; | ^^^^^^^ lifetime argument not allowed -error[E0110]: lifetime arguments are not allowed on this entity +error[E0109]: lifetime arguments are not allowed for this type --> $DIR/prim-with-args.rs:25:13 | LL | let x: char<'static>; @@ -132,5 +132,4 @@ LL | let x: char<'static>; error: aborting due to 22 previous errors -Some errors occurred: E0109, E0110. -For more information about an error, try `rustc --explain E0109`. +For more information about this error, try `rustc --explain E0109`. diff --git a/src/test/ui/qualified/qualified-path-params-2.rs b/src/test/ui/qualified/qualified-path-params-2.rs index 8412983fda549..ebdd749046239 100644 --- a/src/test/ui/qualified/qualified-path-params-2.rs +++ b/src/test/ui/qualified/qualified-path-params-2.rs @@ -16,7 +16,7 @@ impl S { } type A = ::A::f; -//~^ ERROR type arguments are not allowed on this entity +//~^ ERROR type arguments are not allowed for this type //~| ERROR ambiguous associated type fn main() {} diff --git a/src/test/ui/qualified/qualified-path-params-2.stderr b/src/test/ui/qualified/qualified-path-params-2.stderr index 4e073841b9740..2d14d6c5aa898 100644 --- a/src/test/ui/qualified/qualified-path-params-2.stderr +++ b/src/test/ui/qualified/qualified-path-params-2.stderr @@ -1,4 +1,4 @@ -error[E0109]: type arguments are not allowed on this entity +error[E0109]: type arguments are not allowed for this type --> $DIR/qualified-path-params-2.rs:18:26 | LL | type A = ::A::f; diff --git a/src/test/ui/rfc1598-generic-associated-types/collections.rs b/src/test/ui/rfc1598-generic-associated-types/collections.rs index 5414bb4a6d20e..ede6a3b2b3938 100644 --- a/src/test/ui/rfc1598-generic-associated-types/collections.rs +++ b/src/test/ui/rfc1598-generic-associated-types/collections.rs @@ -2,7 +2,7 @@ //~^ WARNING the feature `generic_associated_types` is incomplete #![feature(associated_type_defaults)] -// FIXME(#44265): "lifetime arguments are not allowed on this entity" errors will be addressed in a +// FIXME(#44265): "lifetime arguments are not allowed for this type" errors will be addressed in a // follow-up PR. // A Collection trait and collection families. Based on @@ -15,14 +15,14 @@ trait Collection { // Test associated type defaults with parameters type Sibling: Collection = <>::Family as CollectionFamily>::Member; - //~^ ERROR type arguments are not allowed on this entity [E0109] + //~^ ERROR type arguments are not allowed for this type [E0109] fn empty() -> Self; fn add(&mut self, value: T); fn iterate<'iter>(&'iter self) -> Self::Iter<'iter>; - //~^ ERROR lifetime arguments are not allowed on this entity [E0110] + //~^ ERROR lifetime arguments are not allowed for this type [E0109] } trait CollectionFamily { @@ -48,13 +48,13 @@ impl Collection for Vec { } fn iterate<'iter>(&'iter self) -> Self::Iter<'iter> { - //~^ ERROR lifetime arguments are not allowed on this entity [E0110] + //~^ ERROR lifetime arguments are not allowed for this type [E0109] self.iter() } } fn floatify(ints: &C) -> <>::Family as CollectionFamily>::Member -//~^ ERROR type arguments are not allowed on this entity [E0109] +//~^ ERROR type arguments are not allowed for this type [E0109] where C: Collection, { @@ -66,7 +66,7 @@ where } fn floatify_sibling(ints: &C) -> >::Sibling -//~^ ERROR type arguments are not allowed on this entity [E0109] +//~^ ERROR type arguments are not allowed for this type [E0109] where C: Collection, { diff --git a/src/test/ui/rfc1598-generic-associated-types/collections.stderr b/src/test/ui/rfc1598-generic-associated-types/collections.stderr index eeed04bd89213..d0fe5035bca46 100644 --- a/src/test/ui/rfc1598-generic-associated-types/collections.stderr +++ b/src/test/ui/rfc1598-generic-associated-types/collections.stderr @@ -4,31 +4,31 @@ warning: the feature `generic_associated_types` is incomplete and may cause the LL | #![feature(generic_associated_types)] | ^^^^^^^^^^^^^^^^^^^^^^^^ -error[E0109]: type arguments are not allowed on this entity +error[E0109]: type arguments are not allowed for this type --> $DIR/collections.rs:56:90 | LL | fn floatify(ints: &C) -> <>::Family as CollectionFamily>::Member | ^^^ type argument not allowed -error[E0109]: type arguments are not allowed on this entity +error[E0109]: type arguments are not allowed for this type --> $DIR/collections.rs:68:69 | LL | fn floatify_sibling(ints: &C) -> >::Sibling | ^^^ type argument not allowed -error[E0109]: type arguments are not allowed on this entity +error[E0109]: type arguments are not allowed for this type --> $DIR/collections.rs:17:71 | LL | <>::Family as CollectionFamily>::Member; | ^ type argument not allowed -error[E0110]: lifetime arguments are not allowed on this entity +error[E0109]: lifetime arguments are not allowed for this type --> $DIR/collections.rs:24:50 | LL | fn iterate<'iter>(&'iter self) -> Self::Iter<'iter>; | ^^^^^ lifetime argument not allowed -error[E0110]: lifetime arguments are not allowed on this entity +error[E0109]: lifetime arguments are not allowed for this type --> $DIR/collections.rs:50:50 | LL | fn iterate<'iter>(&'iter self) -> Self::Iter<'iter> { @@ -36,5 +36,4 @@ LL | fn iterate<'iter>(&'iter self) -> Self::Iter<'iter> { error: aborting due to 5 previous errors -Some errors occurred: E0109, E0110. -For more information about an error, try `rustc --explain E0109`. +For more information about this error, try `rustc --explain E0109`. diff --git a/src/test/ui/rfc1598-generic-associated-types/construct_with_other_type.rs b/src/test/ui/rfc1598-generic-associated-types/construct_with_other_type.rs index d9c482e23e47c..3a459a4551c8d 100644 --- a/src/test/ui/rfc1598-generic-associated-types/construct_with_other_type.rs +++ b/src/test/ui/rfc1598-generic-associated-types/construct_with_other_type.rs @@ -3,7 +3,7 @@ use std::ops::Deref; -// FIXME(#44265): "lifetime arguments are not allowed on this entity" errors will be addressed in a +// FIXME(#44265): "lifetime arguments are not allowed for this type" errors will be addressed in a // follow-up PR. trait Foo { @@ -15,15 +15,15 @@ trait Baz { // This weird type tests that we can use universal function call syntax to access the Item on type Baa<'a>: Deref as Foo>::Bar<'a, 'static>>; - //~^ ERROR lifetime arguments are not allowed on this entity [E0110] - //~| ERROR lifetime arguments are not allowed on this entity [E0110] + //~^ ERROR lifetime arguments are not allowed for this type [E0109] + //~| ERROR lifetime arguments are not allowed for this type [E0109] } impl Baz for T where T: Foo { type Quux<'a> = T; type Baa<'a> = &'a ::Bar<'a, 'static>; - //~^ ERROR lifetime arguments are not allowed on this entity [E0110] + //~^ ERROR lifetime arguments are not allowed for this type [E0109] } fn main() {} diff --git a/src/test/ui/rfc1598-generic-associated-types/construct_with_other_type.stderr b/src/test/ui/rfc1598-generic-associated-types/construct_with_other_type.stderr index fd6116d2da23a..b2dd523c8f597 100644 --- a/src/test/ui/rfc1598-generic-associated-types/construct_with_other_type.stderr +++ b/src/test/ui/rfc1598-generic-associated-types/construct_with_other_type.stderr @@ -4,19 +4,19 @@ warning: the feature `generic_associated_types` is incomplete and may cause the LL | #![feature(generic_associated_types)] | ^^^^^^^^^^^^^^^^^^^^^^^^ -error[E0110]: lifetime arguments are not allowed on this entity +error[E0109]: lifetime arguments are not allowed for this type --> $DIR/construct_with_other_type.rs:17:46 | LL | type Baa<'a>: Deref as Foo>::Bar<'a, 'static>>; | ^^ lifetime argument not allowed -error[E0110]: lifetime arguments are not allowed on this entity +error[E0109]: lifetime arguments are not allowed for this type --> $DIR/construct_with_other_type.rs:17:63 | LL | type Baa<'a>: Deref as Foo>::Bar<'a, 'static>>; | ^^ lifetime argument not allowed -error[E0110]: lifetime arguments are not allowed on this entity +error[E0109]: lifetime arguments are not allowed for this type --> $DIR/construct_with_other_type.rs:25:40 | LL | type Baa<'a> = &'a ::Bar<'a, 'static>; @@ -24,4 +24,4 @@ LL | type Baa<'a> = &'a ::Bar<'a, 'static>; error: aborting due to 3 previous errors -For more information about this error, try `rustc --explain E0110`. +For more information about this error, try `rustc --explain E0109`. diff --git a/src/test/ui/rfc1598-generic-associated-types/generic_associated_type_undeclared_lifetimes.rs b/src/test/ui/rfc1598-generic-associated-types/generic_associated_type_undeclared_lifetimes.rs index 2e6d7470b49a2..150899a034b86 100644 --- a/src/test/ui/rfc1598-generic-associated-types/generic_associated_type_undeclared_lifetimes.rs +++ b/src/test/ui/rfc1598-generic-associated-types/generic_associated_type_undeclared_lifetimes.rs @@ -3,20 +3,20 @@ use std::ops::Deref; -// FIXME(#44265): "lifetime arguments are not allowed on this entity" errors will be addressed in a +// FIXME(#44265): "lifetime arguments are not allowed for this type" errors will be addressed in a // follow-up PR. trait Iterable { type Item<'a>; type Iter<'a>: Iterator> - //~^ ERROR lifetime arguments are not allowed on this entity [E0110] + //~^ ERROR lifetime arguments are not allowed for this type [E0109] + Deref>; //~^ ERROR undeclared lifetime - //~| ERROR lifetime arguments are not allowed on this entity [E0110] + //~| ERROR lifetime arguments are not allowed for this type [E0109] fn iter<'a>(&'a self) -> Self::Iter<'undeclared>; //~^ ERROR undeclared lifetime - //~| ERROR lifetime arguments are not allowed on this entity [E0110] + //~| ERROR lifetime arguments are not allowed for this type [E0109] } fn main() {} diff --git a/src/test/ui/rfc1598-generic-associated-types/generic_associated_type_undeclared_lifetimes.stderr b/src/test/ui/rfc1598-generic-associated-types/generic_associated_type_undeclared_lifetimes.stderr index 3cebab6389557..d65edc6f7e247 100644 --- a/src/test/ui/rfc1598-generic-associated-types/generic_associated_type_undeclared_lifetimes.stderr +++ b/src/test/ui/rfc1598-generic-associated-types/generic_associated_type_undeclared_lifetimes.stderr @@ -16,19 +16,19 @@ error[E0261]: use of undeclared lifetime name `'undeclared` LL | fn iter<'a>(&'a self) -> Self::Iter<'undeclared>; | ^^^^^^^^^^^ undeclared lifetime -error[E0110]: lifetime arguments are not allowed on this entity +error[E0109]: lifetime arguments are not allowed for this type --> $DIR/generic_associated_type_undeclared_lifetimes.rs:11:47 | LL | type Iter<'a>: Iterator> | ^^ lifetime argument not allowed -error[E0110]: lifetime arguments are not allowed on this entity +error[E0109]: lifetime arguments are not allowed for this type --> $DIR/generic_associated_type_undeclared_lifetimes.rs:13:37 | LL | + Deref>; | ^^ lifetime argument not allowed -error[E0110]: lifetime arguments are not allowed on this entity +error[E0109]: lifetime arguments are not allowed for this type --> $DIR/generic_associated_type_undeclared_lifetimes.rs:17:41 | LL | fn iter<'a>(&'a self) -> Self::Iter<'undeclared>; @@ -36,5 +36,5 @@ LL | fn iter<'a>(&'a self) -> Self::Iter<'undeclared>; error: aborting due to 5 previous errors -Some errors occurred: E0110, E0261. -For more information about an error, try `rustc --explain E0110`. +Some errors occurred: E0109, E0261. +For more information about an error, try `rustc --explain E0109`. diff --git a/src/test/ui/rfc1598-generic-associated-types/iterable.rs b/src/test/ui/rfc1598-generic-associated-types/iterable.rs index 69258506651c4..29953b9db1a31 100644 --- a/src/test/ui/rfc1598-generic-associated-types/iterable.rs +++ b/src/test/ui/rfc1598-generic-associated-types/iterable.rs @@ -3,16 +3,16 @@ use std::ops::Deref; -// FIXME(#44265): "lifetime arguments are not allowed on this entity" errors will be addressed in a +// FIXME(#44265): "lifetime arguments are not allowed for this type" errors will be addressed in a // follow-up PR. trait Iterable { type Item<'a>; type Iter<'a>: Iterator>; - //~^ ERROR lifetime arguments are not allowed on this entity [E0110] + //~^ ERROR lifetime arguments are not allowed for this type [E0109] fn iter<'a>(&'a self) -> Self::Iter<'a>; - //~^ ERROR lifetime arguments are not allowed on this entity [E0110] + //~^ ERROR lifetime arguments are not allowed for this type [E0109] } // Impl for struct type @@ -21,7 +21,7 @@ impl Iterable for Vec { type Iter<'a> = std::slice::Iter<'a, T>; fn iter<'a>(&'a self) -> Self::Iter<'a> { - //~^ ERROR lifetime arguments are not allowed on this entity [E0110] + //~^ ERROR lifetime arguments are not allowed for this type [E0109] self.iter() } } @@ -32,18 +32,18 @@ impl Iterable for [T] { type Iter<'a> = std::slice::Iter<'a, T>; fn iter<'a>(&'a self) -> Self::Iter<'a> { - //~^ ERROR lifetime arguments are not allowed on this entity [E0110] + //~^ ERROR lifetime arguments are not allowed for this type [E0109] self.iter() } } fn make_iter<'a, I: Iterable>(it: &'a I) -> I::Iter<'a> { - //~^ ERROR lifetime arguments are not allowed on this entity [E0110] + //~^ ERROR lifetime arguments are not allowed for this type [E0109] it.iter() } fn get_first<'a, I: Iterable>(it: &'a I) -> Option> { - //~^ ERROR lifetime arguments are not allowed on this entity [E0110] + //~^ ERROR lifetime arguments are not allowed for this type [E0109] it.iter().next() } diff --git a/src/test/ui/rfc1598-generic-associated-types/iterable.stderr b/src/test/ui/rfc1598-generic-associated-types/iterable.stderr index cc3ade6f39d90..6d5d0cc382840 100644 --- a/src/test/ui/rfc1598-generic-associated-types/iterable.stderr +++ b/src/test/ui/rfc1598-generic-associated-types/iterable.stderr @@ -4,37 +4,37 @@ warning: the feature `generic_associated_types` is incomplete and may cause the LL | #![feature(generic_associated_types)] | ^^^^^^^^^^^^^^^^^^^^^^^^ -error[E0110]: lifetime arguments are not allowed on this entity +error[E0109]: lifetime arguments are not allowed for this type --> $DIR/iterable.rs:11:47 | LL | type Iter<'a>: Iterator>; | ^^ lifetime argument not allowed -error[E0110]: lifetime arguments are not allowed on this entity +error[E0109]: lifetime arguments are not allowed for this type --> $DIR/iterable.rs:40:53 | LL | fn make_iter<'a, I: Iterable>(it: &'a I) -> I::Iter<'a> { | ^^ lifetime argument not allowed -error[E0110]: lifetime arguments are not allowed on this entity +error[E0109]: lifetime arguments are not allowed for this type --> $DIR/iterable.rs:45:60 | LL | fn get_first<'a, I: Iterable>(it: &'a I) -> Option> { | ^^ lifetime argument not allowed -error[E0110]: lifetime arguments are not allowed on this entity +error[E0109]: lifetime arguments are not allowed for this type --> $DIR/iterable.rs:14:41 | LL | fn iter<'a>(&'a self) -> Self::Iter<'a>; | ^^ lifetime argument not allowed -error[E0110]: lifetime arguments are not allowed on this entity +error[E0109]: lifetime arguments are not allowed for this type --> $DIR/iterable.rs:23:41 | LL | fn iter<'a>(&'a self) -> Self::Iter<'a> { | ^^ lifetime argument not allowed -error[E0110]: lifetime arguments are not allowed on this entity +error[E0109]: lifetime arguments are not allowed for this type --> $DIR/iterable.rs:34:41 | LL | fn iter<'a>(&'a self) -> Self::Iter<'a> { @@ -42,4 +42,4 @@ LL | fn iter<'a>(&'a self) -> Self::Iter<'a> { error: aborting due to 6 previous errors -For more information about this error, try `rustc --explain E0110`. +For more information about this error, try `rustc --explain E0109`. diff --git a/src/test/ui/rfc1598-generic-associated-types/parameter_number_and_kind.rs b/src/test/ui/rfc1598-generic-associated-types/parameter_number_and_kind.rs index 851e331a0e965..aa3f4b186da83 100644 --- a/src/test/ui/rfc1598-generic-associated-types/parameter_number_and_kind.rs +++ b/src/test/ui/rfc1598-generic-associated-types/parameter_number_and_kind.rs @@ -2,7 +2,7 @@ //~^ WARNING the feature `generic_associated_types` is incomplete #![feature(associated_type_defaults)] -// FIXME(#44265): "lifetime arguments are not allowed on this entity" errors will be addressed in a +// FIXME(#44265): "lifetime arguments are not allowed for this type" errors will be addressed in a // follow-up PR. // FIXME(#44265): Update expected errors once E110 is resolved, now does not get past `trait Foo`. @@ -15,13 +15,13 @@ trait Foo { type E<'a, T>; // Test parameters in default values type FOk = Self::E<'static, T>; - //~^ ERROR type arguments are not allowed on this entity [E0109] - //~| ERROR lifetime arguments are not allowed on this entity [E0110] + //~^ ERROR type arguments are not allowed for this type [E0109] + //~| ERROR lifetime arguments are not allowed for this type [E0109] type FErr1 = Self::E<'static, 'static>; // Error - //~^ ERROR lifetime arguments are not allowed on this entity [E0110] + //~^ ERROR lifetime arguments are not allowed for this type [E0109] type FErr2 = Self::E<'static, T, u32>; // Error - //~^ ERROR type arguments are not allowed on this entity [E0109] - //~| ERROR lifetime arguments are not allowed on this entity [E0110] + //~^ ERROR type arguments are not allowed for this type [E0109] + //~| ERROR lifetime arguments are not allowed for this type [E0109] } struct Fooy; diff --git a/src/test/ui/rfc1598-generic-associated-types/parameter_number_and_kind.stderr b/src/test/ui/rfc1598-generic-associated-types/parameter_number_and_kind.stderr index 265b0fab77061..817d911184d0a 100644 --- a/src/test/ui/rfc1598-generic-associated-types/parameter_number_and_kind.stderr +++ b/src/test/ui/rfc1598-generic-associated-types/parameter_number_and_kind.stderr @@ -4,31 +4,31 @@ warning: the feature `generic_associated_types` is incomplete and may cause the LL | #![feature(generic_associated_types)] | ^^^^^^^^^^^^^^^^^^^^^^^^ -error[E0110]: lifetime arguments are not allowed on this entity +error[E0109]: lifetime arguments are not allowed for this type --> $DIR/parameter_number_and_kind.rs:17:27 | LL | type FOk = Self::E<'static, T>; | ^^^^^^^ lifetime argument not allowed -error[E0109]: type arguments are not allowed on this entity +error[E0109]: type arguments are not allowed for this type --> $DIR/parameter_number_and_kind.rs:17:36 | LL | type FOk = Self::E<'static, T>; | ^ type argument not allowed -error[E0110]: lifetime arguments are not allowed on this entity +error[E0109]: lifetime arguments are not allowed for this type --> $DIR/parameter_number_and_kind.rs:20:26 | LL | type FErr1 = Self::E<'static, 'static>; // Error | ^^^^^^^ lifetime argument not allowed -error[E0110]: lifetime arguments are not allowed on this entity +error[E0109]: lifetime arguments are not allowed for this type --> $DIR/parameter_number_and_kind.rs:22:29 | LL | type FErr2 = Self::E<'static, T, u32>; // Error | ^^^^^^^ lifetime argument not allowed -error[E0109]: type arguments are not allowed on this entity +error[E0109]: type arguments are not allowed for this type --> $DIR/parameter_number_and_kind.rs:22:38 | LL | type FErr2 = Self::E<'static, T, u32>; // Error @@ -36,5 +36,4 @@ LL | type FErr2 = Self::E<'static, T, u32>; // Error error: aborting due to 5 previous errors -Some errors occurred: E0109, E0110. -For more information about an error, try `rustc --explain E0109`. +For more information about this error, try `rustc --explain E0109`. diff --git a/src/test/ui/rfc1598-generic-associated-types/pointer_family.rs b/src/test/ui/rfc1598-generic-associated-types/pointer_family.rs index 2d188aed42778..edeeaba756549 100644 --- a/src/test/ui/rfc1598-generic-associated-types/pointer_family.rs +++ b/src/test/ui/rfc1598-generic-associated-types/pointer_family.rs @@ -10,7 +10,7 @@ use std::ops::Deref; trait PointerFamily { type Pointer: Deref; fn new(value: T) -> Self::Pointer; - //~^ ERROR type arguments are not allowed on this entity [E0109] + //~^ ERROR type arguments are not allowed for this type [E0109] } struct ArcFamily; @@ -18,7 +18,7 @@ struct ArcFamily; impl PointerFamily for ArcFamily { type Pointer = Arc; fn new(value: T) -> Self::Pointer { - //~^ ERROR type arguments are not allowed on this entity [E0109] + //~^ ERROR type arguments are not allowed for this type [E0109] Arc::new(value) } } @@ -28,14 +28,14 @@ struct RcFamily; impl PointerFamily for RcFamily { type Pointer = Rc; fn new(value: T) -> Self::Pointer { - //~^ ERROR type arguments are not allowed on this entity [E0109] + //~^ ERROR type arguments are not allowed for this type [E0109] Rc::new(value) } } struct Foo { bar: P::Pointer, - //~^ ERROR type arguments are not allowed on this entity [E0109] + //~^ ERROR type arguments are not allowed for this type [E0109] } fn main() {} diff --git a/src/test/ui/rfc1598-generic-associated-types/pointer_family.stderr b/src/test/ui/rfc1598-generic-associated-types/pointer_family.stderr index 2b9eed2a688a2..0966f8f9422aa 100644 --- a/src/test/ui/rfc1598-generic-associated-types/pointer_family.stderr +++ b/src/test/ui/rfc1598-generic-associated-types/pointer_family.stderr @@ -4,25 +4,25 @@ warning: the feature `generic_associated_types` is incomplete and may cause the LL | #![feature(generic_associated_types)] | ^^^^^^^^^^^^^^^^^^^^^^^^ -error[E0109]: type arguments are not allowed on this entity +error[E0109]: type arguments are not allowed for this type --> $DIR/pointer_family.rs:37:21 | LL | bar: P::Pointer, | ^^^^^^ type argument not allowed -error[E0109]: type arguments are not allowed on this entity +error[E0109]: type arguments are not allowed for this type --> $DIR/pointer_family.rs:12:42 | LL | fn new(value: T) -> Self::Pointer; | ^ type argument not allowed -error[E0109]: type arguments are not allowed on this entity +error[E0109]: type arguments are not allowed for this type --> $DIR/pointer_family.rs:20:42 | LL | fn new(value: T) -> Self::Pointer { | ^ type argument not allowed -error[E0109]: type arguments are not allowed on this entity +error[E0109]: type arguments are not allowed for this type --> $DIR/pointer_family.rs:30:42 | LL | fn new(value: T) -> Self::Pointer { diff --git a/src/test/ui/rfc1598-generic-associated-types/streaming_iterator.rs b/src/test/ui/rfc1598-generic-associated-types/streaming_iterator.rs index e0184164b3ac2..4e177fb41d732 100644 --- a/src/test/ui/rfc1598-generic-associated-types/streaming_iterator.rs +++ b/src/test/ui/rfc1598-generic-associated-types/streaming_iterator.rs @@ -10,13 +10,13 @@ trait StreamingIterator { type Item<'a>; // Applying the lifetime parameter `'a` to `Self::Item` inside the trait. fn next<'a>(&'a self) -> Option>; - //~^ ERROR lifetime arguments are not allowed on this entity [E0110] + //~^ ERROR lifetime arguments are not allowed for this type [E0109] } struct Foo { // Applying a concrete lifetime to the constructor outside the trait. bar: ::Item<'static>, - //~^ ERROR lifetime arguments are not allowed on this entity [E0110] + //~^ ERROR lifetime arguments are not allowed for this type [E0109] } // Users can bound parameters by the type constructed by that trait's associated type constructor @@ -24,7 +24,7 @@ struct Foo { //FIXME(sunjay): This next line should parse and be valid //fn foo StreamingIterator=&'a [i32]>>(iter: T) { /* ... */ } fn foo(iter: T) where T: StreamingIterator, for<'a> T::Item<'a>: Display { /* ... */ } -//~^ ERROR lifetime arguments are not allowed on this entity [E0110] +//~^ ERROR lifetime arguments are not allowed for this type [E0109] // Full example of enumerate iterator @@ -36,9 +36,9 @@ struct StreamEnumerate { impl StreamingIterator for StreamEnumerate { type Item<'a> = (usize, I::Item<'a>); - //~^ ERROR lifetime arguments are not allowed on this entity [E0110] + //~^ ERROR lifetime arguments are not allowed for this type [E0109] fn next<'a>(&'a self) -> Option> { - //~^ ERROR lifetime arguments are not allowed on this entity [E0110] + //~^ ERROR lifetime arguments are not allowed for this type [E0109] match self.iter.next() { None => None, Some(val) => { diff --git a/src/test/ui/rfc1598-generic-associated-types/streaming_iterator.stderr b/src/test/ui/rfc1598-generic-associated-types/streaming_iterator.stderr index 5afbba5d2d744..5fc1e3dddbe74 100644 --- a/src/test/ui/rfc1598-generic-associated-types/streaming_iterator.stderr +++ b/src/test/ui/rfc1598-generic-associated-types/streaming_iterator.stderr @@ -4,31 +4,31 @@ warning: the feature `generic_associated_types` is incomplete and may cause the LL | #![feature(generic_associated_types)] | ^^^^^^^^^^^^^^^^^^^^^^^^ -error[E0110]: lifetime arguments are not allowed on this entity +error[E0109]: lifetime arguments are not allowed for this type --> $DIR/streaming_iterator.rs:18:41 | LL | bar: ::Item<'static>, | ^^^^^^^ lifetime argument not allowed -error[E0110]: lifetime arguments are not allowed on this entity +error[E0109]: lifetime arguments are not allowed for this type --> $DIR/streaming_iterator.rs:26:64 | LL | fn foo(iter: T) where T: StreamingIterator, for<'a> T::Item<'a>: Display { /* ... */ } | ^^ lifetime argument not allowed -error[E0110]: lifetime arguments are not allowed on this entity +error[E0109]: lifetime arguments are not allowed for this type --> $DIR/streaming_iterator.rs:12:48 | LL | fn next<'a>(&'a self) -> Option>; | ^^ lifetime argument not allowed -error[E0110]: lifetime arguments are not allowed on this entity +error[E0109]: lifetime arguments are not allowed for this type --> $DIR/streaming_iterator.rs:38:37 | LL | type Item<'a> = (usize, I::Item<'a>); | ^^ lifetime argument not allowed -error[E0110]: lifetime arguments are not allowed on this entity +error[E0109]: lifetime arguments are not allowed for this type --> $DIR/streaming_iterator.rs:40:48 | LL | fn next<'a>(&'a self) -> Option> { @@ -36,4 +36,4 @@ LL | fn next<'a>(&'a self) -> Option> { error: aborting due to 5 previous errors -For more information about this error, try `rustc --explain E0110`. +For more information about this error, try `rustc --explain E0109`. diff --git a/src/test/ui/structs/struct-path-associated-type.rs b/src/test/ui/structs/struct-path-associated-type.rs index 7c770852d22d2..15b37facc502d 100644 --- a/src/test/ui/structs/struct-path-associated-type.rs +++ b/src/test/ui/structs/struct-path-associated-type.rs @@ -13,7 +13,7 @@ fn f() { //~^ ERROR expected struct, variant or union type, found associated type let z = T::A:: {}; //~^ ERROR expected struct, variant or union type, found associated type - //~| ERROR type arguments are not allowed on this entity + //~| ERROR type arguments are not allowed for this type match S { T::A {} => {} //~^ ERROR expected struct, variant or union type, found associated type @@ -22,7 +22,7 @@ fn f() { fn g>() { let s = T::A {}; // OK - let z = T::A:: {}; //~ ERROR type arguments are not allowed on this entity + let z = T::A:: {}; //~ ERROR type arguments are not allowed for this type match S { T::A {} => {} // OK } @@ -31,7 +31,7 @@ fn g>() { fn main() { let s = S::A {}; //~ ERROR ambiguous associated type let z = S::A:: {}; //~ ERROR ambiguous associated type - //~^ ERROR type arguments are not allowed on this entity + //~^ ERROR type arguments are not allowed for this type match S { S::A {} => {} //~ ERROR ambiguous associated type } diff --git a/src/test/ui/structs/struct-path-associated-type.stderr b/src/test/ui/structs/struct-path-associated-type.stderr index 0ca64ed40a50b..f054bd3d29776 100644 --- a/src/test/ui/structs/struct-path-associated-type.stderr +++ b/src/test/ui/structs/struct-path-associated-type.stderr @@ -4,7 +4,7 @@ error[E0071]: expected struct, variant or union type, found associated type LL | let s = T::A {}; | ^^^^ not a struct -error[E0109]: type arguments are not allowed on this entity +error[E0109]: type arguments are not allowed for this type --> $DIR/struct-path-associated-type.rs:14:20 | LL | let z = T::A:: {}; @@ -22,7 +22,7 @@ error[E0071]: expected struct, variant or union type, found associated type LL | T::A {} => {} | ^^^^ not a struct -error[E0109]: type arguments are not allowed on this entity +error[E0109]: type arguments are not allowed for this type --> $DIR/struct-path-associated-type.rs:25:20 | LL | let z = T::A:: {}; @@ -34,7 +34,7 @@ error[E0223]: ambiguous associated type LL | let s = S::A {}; | ^^^^ help: use fully-qualified syntax: `::A` -error[E0109]: type arguments are not allowed on this entity +error[E0109]: type arguments are not allowed for this type --> $DIR/struct-path-associated-type.rs:33:20 | LL | let z = S::A:: {}; diff --git a/src/test/ui/structs/struct-path-self.rs b/src/test/ui/structs/struct-path-self.rs index 51ed9e5457eb7..77880bfca4074 100644 --- a/src/test/ui/structs/struct-path-self.rs +++ b/src/test/ui/structs/struct-path-self.rs @@ -6,7 +6,7 @@ trait Tr { //~^ ERROR expected struct, variant or union type, found Self let z = Self:: {}; //~^ ERROR expected struct, variant or union type, found Self - //~| ERROR type arguments are not allowed on this entity + //~| ERROR type arguments are not allowed for this type match s { Self { .. } => {} //~^ ERROR expected struct, variant or union type, found Self @@ -17,7 +17,7 @@ trait Tr { impl Tr for S { fn f() { let s = Self {}; // OK - let z = Self:: {}; //~ ERROR type arguments are not allowed on this entity + let z = Self:: {}; //~ ERROR type arguments are not allowed for this type match s { Self { .. } => {} // OK } @@ -27,7 +27,7 @@ impl Tr for S { impl S { fn g() { let s = Self {}; // OK - let z = Self:: {}; //~ ERROR type arguments are not allowed on this entity + let z = Self:: {}; //~ ERROR type arguments are not allowed for this type match s { Self { .. } => {} // OK } diff --git a/src/test/ui/structs/struct-path-self.stderr b/src/test/ui/structs/struct-path-self.stderr index 0fb02b9c44b51..d9e84acdb3cda 100644 --- a/src/test/ui/structs/struct-path-self.stderr +++ b/src/test/ui/structs/struct-path-self.stderr @@ -4,7 +4,7 @@ error[E0071]: expected struct, variant or union type, found Self LL | let s = Self {}; | ^^^^ not a struct -error[E0109]: type arguments are not allowed on this entity +error[E0109]: type arguments are not allowed for this type --> $DIR/struct-path-self.rs:7:24 | LL | let z = Self:: {}; @@ -22,13 +22,13 @@ error[E0071]: expected struct, variant or union type, found Self LL | Self { .. } => {} | ^^^^ not a struct -error[E0109]: type arguments are not allowed on this entity +error[E0109]: type arguments are not allowed for this type --> $DIR/struct-path-self.rs:20:24 | LL | let z = Self:: {}; | ^^ type argument not allowed -error[E0109]: type arguments are not allowed on this entity +error[E0109]: type arguments are not allowed for this type --> $DIR/struct-path-self.rs:30:24 | LL | let z = Self:: {}; diff --git a/src/test/ui/type-alias-enum-variants.rs b/src/test/ui/type-alias-enum-variants.rs index 3ec200d57c55d..c5974e5569223 100644 --- a/src/test/ui/type-alias-enum-variants.rs +++ b/src/test/ui/type-alias-enum-variants.rs @@ -7,5 +7,5 @@ fn main() { let _ = Option::None::; // OK (Lint in future!) let _ = Alias::::None; // OK let _ = Alias::None::; // Error - //~^ type arguments are not allowed on this entity + //~^ type arguments are not allowed for this type } diff --git a/src/test/ui/type-alias-enum-variants.stderr b/src/test/ui/type-alias-enum-variants.stderr index cf81f5b27ac6b..55f250fa7ee52 100644 --- a/src/test/ui/type-alias-enum-variants.stderr +++ b/src/test/ui/type-alias-enum-variants.stderr @@ -1,4 +1,4 @@ -error[E0109]: type arguments are not allowed on this entity +error[E0109]: type arguments are not allowed for this type --> $DIR/type-alias-enum-variants.rs:9:27 | LL | let _ = Alias::None::; // Error