From 455d659e91c6e7b0b9eee15066e85180b9ade584 Mon Sep 17 00:00:00 2001 From: varkor Date: Tue, 5 Feb 2019 17:00:19 +0100 Subject: [PATCH] Update tests Co-Authored-By: Gabriel Smith --- .../attrs-with-no-formal-in-generics-1.rs | 2 +- .../attrs-with-no-formal-in-generics-1.stderr | 2 +- .../attrs-with-no-formal-in-generics-2.rs | 2 +- .../attrs-with-no-formal-in-generics-2.stderr | 2 +- .../attrs-with-no-formal-in-generics-3.rs | 2 +- .../attrs-with-no-formal-in-generics-3.stderr | 2 +- .../duplicate/duplicate-type-parameter.stderr | 14 +- src/test/ui/error-codes/E0403.stderr | 2 +- src/test/ui/issues/issue-20616-3.rs | 6 +- src/test/ui/issues/issue-20616-3.stderr | 6 +- src/test/ui/issues/issue-20616-4.rs | 4 +- src/test/ui/issues/issue-20616-4.stderr | 6 +- src/test/ui/issues/issue-20616-5.rs | 4 +- src/test/ui/issues/issue-20616-5.stderr | 6 +- src/test/ui/issues/issue-20616-6.rs | 4 +- src/test/ui/issues/issue-20616-6.stderr | 6 +- src/test/ui/issues/issue-20616-7.rs | 6 +- src/test/ui/issues/issue-20616-7.stderr | 6 +- src/test/ui/issues/issue-20616-8.rs | 6 +- src/test/ui/issues/issue-20616-8.stderr | 6 +- src/test/ui/issues/issue-20616-9.rs | 6 +- src/test/ui/issues/issue-20616-9.stderr | 6 +- .../ui/lifetime-before-type-params.stderr | 24 +-- src/test/ui/parser/bounds-lifetime.rs | 2 +- src/test/ui/parser/bounds-lifetime.stderr | 6 +- src/test/ui/parser/issue-14303-enum.stderr | 6 +- src/test/ui/parser/issue-14303-fn-def.stderr | 6 +- src/test/ui/parser/issue-14303-fncall.rs | 2 +- src/test/ui/parser/issue-14303-fncall.stderr | 8 +- src/test/ui/parser/issue-14303-impl.stderr | 6 +- src/test/ui/parser/issue-14303-path.rs | 2 +- src/test/ui/parser/issue-14303-path.stderr | 10 +- src/test/ui/parser/issue-14303-struct.stderr | 6 +- src/test/ui/parser/issue-14303-trait.stderr | 6 +- src/test/ui/parser/issue-32214.rs | 2 +- src/test/ui/parser/issue-32214.stderr | 12 +- .../ui/parser/removed-syntax-uniq-mut-ty.rs | 2 +- .../parser/removed-syntax-uniq-mut-ty.stderr | 6 +- .../empty_generics.rs | 2 +- .../empty_generics.stderr | 4 +- .../suggestions/suggest-move-lifetimes.stderr | 24 +-- src/test/ui/suggestions/suggest-move-types.rs | 20 +- .../ui/suggestions/suggest-move-types.stderr | 177 +++++++++--------- .../ui/traits/trait-object-vs-lifetime.rs | 2 +- .../ui/traits/trait-object-vs-lifetime.stderr | 8 +- 45 files changed, 187 insertions(+), 262 deletions(-) diff --git a/src/test/ui/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-1.rs b/src/test/ui/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-1.rs index d7feb0385307..2ef5f13f3d46 100644 --- a/src/test/ui/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-1.rs +++ b/src/test/ui/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-1.rs @@ -7,7 +7,7 @@ struct RefIntPair<'a, 'b>(&'a u32, &'b u32); impl<#[rustc_1] 'a, 'b, #[oops]> RefIntPair<'a, 'b> { - //~^ ERROR trailing attribute after lifetime parameters + //~^ ERROR trailing attribute after lifetime parameter } fn main() { diff --git a/src/test/ui/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-1.stderr b/src/test/ui/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-1.stderr index c4c0cee5ccc3..97c0a19a3da3 100644 --- a/src/test/ui/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-1.stderr +++ b/src/test/ui/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-1.stderr @@ -1,4 +1,4 @@ -error: trailing attribute after lifetime parameters +error: trailing attribute after lifetime parameter --> $DIR/attrs-with-no-formal-in-generics-1.rs:9:25 | LL | impl<#[rustc_1] 'a, 'b, #[oops]> RefIntPair<'a, 'b> { diff --git a/src/test/ui/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-2.rs b/src/test/ui/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-2.rs index f9db6a5f72af..f58ddd5fbda0 100644 --- a/src/test/ui/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-2.rs +++ b/src/test/ui/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-2.rs @@ -7,6 +7,6 @@ struct RefAny<'a, T>(&'a T); impl<#[rustc_1] 'a, #[rustc_2] T, #[oops]> RefAny<'a, T> {} -//~^ ERROR trailing attribute after type parameters +//~^ ERROR trailing attribute after type parameter fn main() {} diff --git a/src/test/ui/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-2.stderr b/src/test/ui/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-2.stderr index 9099d74ce1be..ff7ced77f25b 100644 --- a/src/test/ui/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-2.stderr +++ b/src/test/ui/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-2.stderr @@ -1,4 +1,4 @@ -error: trailing attribute after type parameters +error: trailing attribute after type parameter --> $DIR/attrs-with-no-formal-in-generics-2.rs:9:35 | LL | impl<#[rustc_1] 'a, #[rustc_2] T, #[oops]> RefAny<'a, T> {} diff --git a/src/test/ui/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-3.rs b/src/test/ui/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-3.rs index e9f908d479f6..44a7c9d7c8b6 100644 --- a/src/test/ui/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-3.rs +++ b/src/test/ui/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-3.rs @@ -6,7 +6,7 @@ struct RefIntPair<'a, 'b>(&'a u32, &'b u32); fn hof_lt(_: Q) where Q: for <#[allow(unused)] 'a, 'b, #[oops]> Fn(RefIntPair<'a,'b>) -> &'b u32 - //~^ ERROR trailing attribute after lifetime parameters + //~^ ERROR trailing attribute after lifetime parameter {} fn main() {} diff --git a/src/test/ui/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-3.stderr b/src/test/ui/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-3.stderr index 452f0ea5e175..b383e21e1612 100644 --- a/src/test/ui/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-3.stderr +++ b/src/test/ui/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-3.stderr @@ -1,4 +1,4 @@ -error: trailing attribute after lifetime parameters +error: trailing attribute after lifetime parameter --> $DIR/attrs-with-no-formal-in-generics-3.rs:8:44 | LL | where Q: for <#[allow(unused)] 'a, 'b, #[oops]> Fn(RefIntPair<'a,'b>) -> &'b u32 diff --git a/src/test/ui/duplicate/duplicate-type-parameter.stderr b/src/test/ui/duplicate/duplicate-type-parameter.stderr index 41750d4bb362..17d48edc35c9 100644 --- a/src/test/ui/duplicate/duplicate-type-parameter.stderr +++ b/src/test/ui/duplicate/duplicate-type-parameter.stderr @@ -1,4 +1,4 @@ -error[E0403]: the name `T` is already used for a type parameter in this type parameter list +error[E0403]: the name `T` is already used for a generic parameter in this list of generic parameters --> $DIR/duplicate-type-parameter.rs:1:12 | LL | type Foo = Option; @@ -6,7 +6,7 @@ LL | type Foo = Option; | | | first use of `T` -error[E0403]: the name `T` is already used for a type parameter in this type parameter list +error[E0403]: the name `T` is already used for a generic parameter in this list of generic parameters --> $DIR/duplicate-type-parameter.rs:4:14 | LL | struct Bar(T); @@ -14,7 +14,7 @@ LL | struct Bar(T); | | | first use of `T` -error[E0403]: the name `T` is already used for a type parameter in this type parameter list +error[E0403]: the name `T` is already used for a generic parameter in this list of generic parameters --> $DIR/duplicate-type-parameter.rs:7:14 | LL | struct Baz { @@ -22,7 +22,7 @@ LL | struct Baz { | | | first use of `T` -error[E0403]: the name `T` is already used for a type parameter in this type parameter list +error[E0403]: the name `T` is already used for a generic parameter in this list of generic parameters --> $DIR/duplicate-type-parameter.rs:12:12 | LL | enum Boo { @@ -30,7 +30,7 @@ LL | enum Boo { | | | first use of `T` -error[E0403]: the name `T` is already used for a type parameter in this type parameter list +error[E0403]: the name `T` is already used for a generic parameter in this list of generic parameters --> $DIR/duplicate-type-parameter.rs:18:11 | LL | fn quux(x: T) {} @@ -38,7 +38,7 @@ LL | fn quux(x: T) {} | | | first use of `T` -error[E0403]: the name `T` is already used for a type parameter in this type parameter list +error[E0403]: the name `T` is already used for a generic parameter in this list of generic parameters --> $DIR/duplicate-type-parameter.rs:21:13 | LL | trait Qux {} @@ -46,7 +46,7 @@ LL | trait Qux {} | | | first use of `T` -error[E0403]: the name `T` is already used for a type parameter in this type parameter list +error[E0403]: the name `T` is already used for a generic parameter in this list of generic parameters --> $DIR/duplicate-type-parameter.rs:24:8 | LL | impl Qux for Option {} diff --git a/src/test/ui/error-codes/E0403.stderr b/src/test/ui/error-codes/E0403.stderr index 919a82dbe1a7..b92464750296 100644 --- a/src/test/ui/error-codes/E0403.stderr +++ b/src/test/ui/error-codes/E0403.stderr @@ -1,4 +1,4 @@ -error[E0403]: the name `T` is already used for a type parameter in this type parameter list +error[E0403]: the name `T` is already used for a generic parameter in this list of generic parameters --> $DIR/E0403.rs:1:11 | LL | fn foo(s: T, u: T) {} //~ ERROR E0403 diff --git a/src/test/ui/issues/issue-20616-3.rs b/src/test/ui/issues/issue-20616-3.rs index e84506ee249d..9f983f74f5b1 100644 --- a/src/test/ui/issues/issue-20616-3.rs +++ b/src/test/ui/issues/issue-20616-3.rs @@ -1,8 +1,8 @@ +// ignore-tidy-linelength + // We need all these 9 issue-20616-N.rs files // because we can only catch one parsing error at a time - - type Type_1_<'a, T> = &'a T; @@ -12,7 +12,7 @@ type Type_1_<'a, T> = &'a T; //type Type_2 = Type_1_<'static ()>; // error: expected `,` or `>` after lifetime name, found `(` -type Type_3 = Box; //~ error: expected one of `>`, identifier, lifetime, or type, found `,` +type Type_3 = Box; //~ error: expected one of `>`, const, identifier, lifetime, or type, found `,` //type Type_4 = Type_1_<'static,, T>; // error: expected type, found `,` diff --git a/src/test/ui/issues/issue-20616-3.stderr b/src/test/ui/issues/issue-20616-3.stderr index 5247298b7cc2..e8edb5ba70f5 100644 --- a/src/test/ui/issues/issue-20616-3.stderr +++ b/src/test/ui/issues/issue-20616-3.stderr @@ -1,8 +1,8 @@ -error: expected one of `>`, identifier, lifetime, or type, found `,` +error: expected one of `>`, const, identifier, lifetime, or type, found `,` --> $DIR/issue-20616-3.rs:15:24 | -LL | type Type_3 = Box; //~ error: expected one of `>`, identifier, lifetime, or type, found `,` - | ^ expected one of `>`, identifier, lifetime, or type here +LL | type Type_3 = Box; //~ error: expected one of `>`, const, identifier, lifetime, or type, found `,` + | ^ expected one of `>`, const, identifier, lifetime, or type here error: aborting due to previous error diff --git a/src/test/ui/issues/issue-20616-4.rs b/src/test/ui/issues/issue-20616-4.rs index 785a6fa7d9a2..e9a34a04667b 100644 --- a/src/test/ui/issues/issue-20616-4.rs +++ b/src/test/ui/issues/issue-20616-4.rs @@ -1,8 +1,6 @@ // We need all these 9 issue-20616-N.rs files // because we can only catch one parsing error at a time - - type Type_1_<'a, T> = &'a T; @@ -16,7 +14,7 @@ type Type_1_<'a, T> = &'a T; type Type_4 = Type_1_<'static,, T>; -//~^ error: expected one of `>`, identifier, lifetime, or type, found `,` +//~^ error: expected one of `>`, const, identifier, lifetime, or type, found `,` type Type_5_<'a> = Type_1_<'a, ()>; diff --git a/src/test/ui/issues/issue-20616-4.stderr b/src/test/ui/issues/issue-20616-4.stderr index 74c38d9e97d6..22a655465e83 100644 --- a/src/test/ui/issues/issue-20616-4.stderr +++ b/src/test/ui/issues/issue-20616-4.stderr @@ -1,8 +1,8 @@ -error: expected one of `>`, identifier, lifetime, or type, found `,` - --> $DIR/issue-20616-4.rs:18:34 +error: expected one of `>`, const, identifier, lifetime, or type, found `,` + --> $DIR/issue-20616-4.rs:16:34 | LL | type Type_4 = Type_1_<'static,, T>; - | ^ expected one of `>`, identifier, lifetime, or type here + | ^ expected one of `>`, const, identifier, lifetime, or type here error: aborting due to previous error diff --git a/src/test/ui/issues/issue-20616-5.rs b/src/test/ui/issues/issue-20616-5.rs index 71dcc1f3a024..23862516d2cb 100644 --- a/src/test/ui/issues/issue-20616-5.rs +++ b/src/test/ui/issues/issue-20616-5.rs @@ -1,8 +1,6 @@ // We need all these 9 issue-20616-N.rs files // because we can only catch one parsing error at a time - - type Type_1_<'a, T> = &'a T; @@ -22,7 +20,7 @@ type Type_5_<'a> = Type_1_<'a, ()>; type Type_5<'a> = Type_1_<'a, (),,>; -//~^ error: expected one of `>`, identifier, lifetime, or type, found `,` +//~^ error: expected one of `>`, const, identifier, lifetime, or type, found `,` //type Type_6 = Type_5_<'a,,>; // error: expected type, found `,` diff --git a/src/test/ui/issues/issue-20616-5.stderr b/src/test/ui/issues/issue-20616-5.stderr index 38457beadc44..d83fc41f43ec 100644 --- a/src/test/ui/issues/issue-20616-5.stderr +++ b/src/test/ui/issues/issue-20616-5.stderr @@ -1,8 +1,8 @@ -error: expected one of `>`, identifier, lifetime, or type, found `,` - --> $DIR/issue-20616-5.rs:24:34 +error: expected one of `>`, const, identifier, lifetime, or type, found `,` + --> $DIR/issue-20616-5.rs:22:34 | LL | type Type_5<'a> = Type_1_<'a, (),,>; - | ^ expected one of `>`, identifier, lifetime, or type here + | ^ expected one of `>`, const, identifier, lifetime, or type here error: aborting due to previous error diff --git a/src/test/ui/issues/issue-20616-6.rs b/src/test/ui/issues/issue-20616-6.rs index da32da488524..dc327f3f7882 100644 --- a/src/test/ui/issues/issue-20616-6.rs +++ b/src/test/ui/issues/issue-20616-6.rs @@ -1,8 +1,6 @@ // We need all these 9 issue-20616-N.rs files // because we can only catch one parsing error at a time - - type Type_1_<'a, T> = &'a T; @@ -25,7 +23,7 @@ type Type_5_<'a> = Type_1_<'a, ()>; type Type_6 = Type_5_<'a,,>; -//~^ error: expected one of `>`, identifier, lifetime, or type, found `,` +//~^ error: expected one of `>`, const, identifier, lifetime, or type, found `,` //type Type_7 = Box<(),,>; // error: expected type, found `,` diff --git a/src/test/ui/issues/issue-20616-6.stderr b/src/test/ui/issues/issue-20616-6.stderr index 55b1d031a391..0740df595234 100644 --- a/src/test/ui/issues/issue-20616-6.stderr +++ b/src/test/ui/issues/issue-20616-6.stderr @@ -1,8 +1,8 @@ -error: expected one of `>`, identifier, lifetime, or type, found `,` - --> $DIR/issue-20616-6.rs:27:26 +error: expected one of `>`, const, identifier, lifetime, or type, found `,` + --> $DIR/issue-20616-6.rs:25:26 | LL | type Type_6 = Type_5_<'a,,>; - | ^ expected one of `>`, identifier, lifetime, or type here + | ^ expected one of `>`, const, identifier, lifetime, or type here error: aborting due to previous error diff --git a/src/test/ui/issues/issue-20616-7.rs b/src/test/ui/issues/issue-20616-7.rs index feaaff2c8902..277b45245063 100644 --- a/src/test/ui/issues/issue-20616-7.rs +++ b/src/test/ui/issues/issue-20616-7.rs @@ -1,8 +1,8 @@ +// ignore-tidy-linelength + // We need all these 9 issue-20616-N.rs files // because we can only catch one parsing error at a time - - type Type_1_<'a, T> = &'a T; @@ -27,7 +27,7 @@ type Type_5_<'a> = Type_1_<'a, ()>; //type Type_6 = Type_5_<'a,,>; // error: expected type, found `,` -type Type_7 = Box<(),,>; //~ error: expected one of `>`, identifier, lifetime, or type, found `,` +type Type_7 = Box<(),,>; //~ error: expected one of `>`, const, identifier, lifetime, or type, found `,` //type Type_8<'a,,> = &'a (); // error: expected ident, found `,` diff --git a/src/test/ui/issues/issue-20616-7.stderr b/src/test/ui/issues/issue-20616-7.stderr index 8b5f67c703f6..c1422d849fc7 100644 --- a/src/test/ui/issues/issue-20616-7.stderr +++ b/src/test/ui/issues/issue-20616-7.stderr @@ -1,8 +1,8 @@ -error: expected one of `>`, identifier, lifetime, or type, found `,` +error: expected one of `>`, const, identifier, lifetime, or type, found `,` --> $DIR/issue-20616-7.rs:30:22 | -LL | type Type_7 = Box<(),,>; //~ error: expected one of `>`, identifier, lifetime, or type, found `,` - | ^ expected one of `>`, identifier, lifetime, or type here +LL | type Type_7 = Box<(),,>; //~ error: expected one of `>`, const, identifier, lifetime, or type, found `,` + | ^ expected one of `>`, const, identifier, lifetime, or type here error: aborting due to previous error diff --git a/src/test/ui/issues/issue-20616-8.rs b/src/test/ui/issues/issue-20616-8.rs index 2fc7243559a3..756119e01271 100644 --- a/src/test/ui/issues/issue-20616-8.rs +++ b/src/test/ui/issues/issue-20616-8.rs @@ -1,8 +1,8 @@ +// ignore-tidy-linelength + // We need all these 9 issue-20616-N.rs files // because we can only catch one parsing error at a time - - type Type_1_<'a, T> = &'a T; @@ -30,7 +30,7 @@ type Type_5_<'a> = Type_1_<'a, ()>; //type Type_7 = Box<(),,>; // error: expected type, found `,` -type Type_8<'a,,> = &'a (); //~ error: expected one of `>`, identifier, or lifetime, found `,` +type Type_8<'a,,> = &'a (); //~ error: expected one of `>`, `const`, identifier, or lifetime, found `,` //type Type_9 = Box; // error: expected identifier, found `,` diff --git a/src/test/ui/issues/issue-20616-8.stderr b/src/test/ui/issues/issue-20616-8.stderr index cdeb544f07c4..cfe3ec57712d 100644 --- a/src/test/ui/issues/issue-20616-8.stderr +++ b/src/test/ui/issues/issue-20616-8.stderr @@ -1,8 +1,8 @@ -error: expected one of `>`, identifier, or lifetime, found `,` +error: expected one of `>`, `const`, identifier, or lifetime, found `,` --> $DIR/issue-20616-8.rs:33:16 | -LL | type Type_8<'a,,> = &'a (); //~ error: expected one of `>`, identifier, or lifetime, found `,` - | ^ expected one of `>`, identifier, or lifetime here +LL | type Type_8<'a,,> = &'a (); //~ error: expected one of `>`, `const`, identifier, or lifetime, found `,` + | ^ expected one of `>`, `const`, identifier, or lifetime here error: aborting due to previous error diff --git a/src/test/ui/issues/issue-20616-9.rs b/src/test/ui/issues/issue-20616-9.rs index b14a5b0ff36d..6074fbb2204c 100644 --- a/src/test/ui/issues/issue-20616-9.rs +++ b/src/test/ui/issues/issue-20616-9.rs @@ -1,8 +1,8 @@ +// ignore-tidy-linelength + // We need all these 9 issue-20616-N.rs files // because we can only catch one parsing error at a time - - type Type_1_<'a, T> = &'a T; @@ -33,4 +33,4 @@ type Type_5_<'a> = Type_1_<'a, ()>; //type Type_8<'a,,> = &'a (); // error: expected identifier, found `,` -type Type_9 = Box; //~ error: expected one of `>`, identifier, or lifetime, found `,` +type Type_9 = Box; //~ error: expected one of `>`, `const`, identifier, or lifetime, found `,` diff --git a/src/test/ui/issues/issue-20616-9.stderr b/src/test/ui/issues/issue-20616-9.stderr index dfe705c6f12e..960e8c8c0865 100644 --- a/src/test/ui/issues/issue-20616-9.stderr +++ b/src/test/ui/issues/issue-20616-9.stderr @@ -1,8 +1,8 @@ -error: expected one of `>`, identifier, or lifetime, found `,` +error: expected one of `>`, `const`, identifier, or lifetime, found `,` --> $DIR/issue-20616-9.rs:36:15 | -LL | type Type_9 = Box; //~ error: expected one of `>`, identifier, or lifetime, found `,` - | ^ expected one of `>`, identifier, or lifetime here +LL | type Type_9 = Box; //~ error: expected one of `>`, `const`, identifier, or lifetime, found `,` + | ^ expected one of `>`, `const`, identifier, or lifetime here error: aborting due to previous error diff --git a/src/test/ui/lifetime-before-type-params.stderr b/src/test/ui/lifetime-before-type-params.stderr index 7ac8dffdfbe0..3cef5db66c66 100644 --- a/src/test/ui/lifetime-before-type-params.stderr +++ b/src/test/ui/lifetime-before-type-params.stderr @@ -2,41 +2,25 @@ error: lifetime parameters must be declared prior to type parameters --> $DIR/lifetime-before-type-params.rs:2:13 | LL | fn first() {} - | ^^ ^^ -help: move the lifetime parameter prior to the first type parameter - | -LL | fn first<'a, 'b, T>() {} - | ^^^ ^^^ -- + | ----^^--^^- help: reorder the parameters: lifetimes, then types, then consts: `<'a, 'b, T>` error: lifetime parameters must be declared prior to type parameters --> $DIR/lifetime-before-type-params.rs:4:18 | LL | fn second<'a, T, 'b>() {} - | ^^ -help: move the lifetime parameter prior to the first type parameter - | -LL | fn second<'a, 'b, T>() {} - | ^^^ -- + | --------^^- help: reorder the parameters: lifetimes, then types, then consts: `<'a, 'b, T>` error: lifetime parameters must be declared prior to type parameters --> $DIR/lifetime-before-type-params.rs:6:16 | LL | fn third() {} - | ^^ -help: move the lifetime parameter prior to the first type parameter - | -LL | fn third<'a, T, U>() {} - | ^^^ -- + | -------^^- help: reorder the parameters: lifetimes, then types, then consts: `<'a, T, U>` error: lifetime parameters must be declared prior to type parameters --> $DIR/lifetime-before-type-params.rs:8:18 | LL | fn fourth<'a, T, 'b, U, 'c, V>() {} - | ^^ ^^ -help: move the lifetime parameter prior to the first type parameter - | -LL | fn fourth<'a, 'b, 'c, T, U, V>() {} - | ^^^ ^^^ -- -- + | --------^^-----^^---- help: reorder the parameters: lifetimes, then types, then consts: `<'a, 'b, 'c, T, U, V>` error[E0601]: `main` function not found in crate `lifetime_before_type_params` | diff --git a/src/test/ui/parser/bounds-lifetime.rs b/src/test/ui/parser/bounds-lifetime.rs index 89a969bb2e2a..9225cfce94eb 100644 --- a/src/test/ui/parser/bounds-lifetime.rs +++ b/src/test/ui/parser/bounds-lifetime.rs @@ -6,6 +6,6 @@ type A = for<'a: 'b + 'c> fn(); // OK (rejected later by ast_validation) type A = for<'a: 'b,> fn(); // OK(rejected later by ast_validation) type A = for<'a: 'b +> fn(); // OK (rejected later by ast_validation) type A = for<'a, T> fn(); // OK (rejected later by ast_validation) -type A = for<,> fn(); //~ ERROR expected one of `>`, identifier, or lifetime, found `,` +type A = for<,> fn(); //~ ERROR expected one of `>`, `const`, identifier, or lifetime, found `,` fn main() {} diff --git a/src/test/ui/parser/bounds-lifetime.stderr b/src/test/ui/parser/bounds-lifetime.stderr index f39e5beb6ac9..191ea3ebd070 100644 --- a/src/test/ui/parser/bounds-lifetime.stderr +++ b/src/test/ui/parser/bounds-lifetime.stderr @@ -1,8 +1,8 @@ -error: expected one of `>`, identifier, or lifetime, found `,` +error: expected one of `>`, `const`, identifier, or lifetime, found `,` --> $DIR/bounds-lifetime.rs:9:14 | -LL | type A = for<,> fn(); //~ ERROR expected one of `>`, identifier, or lifetime, found `,` - | ^ expected one of `>`, identifier, or lifetime here +LL | type A = for<,> fn(); //~ ERROR expected one of `>`, `const`, identifier, or lifetime, found `,` + | ^ expected one of `>`, `const`, identifier, or lifetime here error: aborting due to previous error diff --git a/src/test/ui/parser/issue-14303-enum.stderr b/src/test/ui/parser/issue-14303-enum.stderr index a31429e7228c..bcecd75b1abb 100644 --- a/src/test/ui/parser/issue-14303-enum.stderr +++ b/src/test/ui/parser/issue-14303-enum.stderr @@ -2,11 +2,7 @@ error: lifetime parameters must be declared prior to type parameters --> $DIR/issue-14303-enum.rs:1:15 | LL | enum X<'a, T, 'b> { - | ^^ -help: move the lifetime parameter prior to the first type parameter - | -LL | enum X<'a, 'b, T> { - | ^^^ -- + | --------^^- help: reorder the parameters: lifetimes, then types, then consts: `<'a, 'b, T>` error: aborting due to previous error diff --git a/src/test/ui/parser/issue-14303-fn-def.stderr b/src/test/ui/parser/issue-14303-fn-def.stderr index 4582aeef428d..082c37e0be79 100644 --- a/src/test/ui/parser/issue-14303-fn-def.stderr +++ b/src/test/ui/parser/issue-14303-fn-def.stderr @@ -2,11 +2,7 @@ error: lifetime parameters must be declared prior to type parameters --> $DIR/issue-14303-fn-def.rs:1:15 | LL | fn foo<'a, T, 'b>(x: &'a T) {} - | ^^ -help: move the lifetime parameter prior to the first type parameter - | -LL | fn foo<'a, 'b, T>(x: &'a T) {} - | ^^^ -- + | --------^^- help: reorder the parameters: lifetimes, then types, then consts: `<'a, 'b, T>` error: aborting due to previous error diff --git a/src/test/ui/parser/issue-14303-fncall.rs b/src/test/ui/parser/issue-14303-fncall.rs index 17b9b766b218..39694198cdb4 100644 --- a/src/test/ui/parser/issue-14303-fncall.rs +++ b/src/test/ui/parser/issue-14303-fncall.rs @@ -11,7 +11,7 @@ fn foo<'a, 'b>(start: &'a usize, end: &'a usize) { let _x = (*start..*end) .map(|x| S { a: start, b: end }) .collect::>>(); - //~^ ERROR lifetime parameters must be declared prior to type parameters + //~^ ERROR lifetime arguments must be declared prior to type arguments } fn main() {} diff --git a/src/test/ui/parser/issue-14303-fncall.stderr b/src/test/ui/parser/issue-14303-fncall.stderr index 2a7364915949..8ef9f1a1a6c7 100644 --- a/src/test/ui/parser/issue-14303-fncall.stderr +++ b/src/test/ui/parser/issue-14303-fncall.stderr @@ -1,12 +1,8 @@ -error: lifetime parameters must be declared prior to type parameters +error: lifetime arguments must be declared prior to type arguments --> $DIR/issue-14303-fncall.rs:13:29 | LL | .collect::>>(); - | ^^ must be declared prior to type parameters -help: move the lifetime parameter prior to the first type parameter - | -LL | .collect::>>(); - | ^^^ -- + | ^^ error: aborting due to previous error diff --git a/src/test/ui/parser/issue-14303-impl.stderr b/src/test/ui/parser/issue-14303-impl.stderr index a1953396153e..3b5615d2a9ec 100644 --- a/src/test/ui/parser/issue-14303-impl.stderr +++ b/src/test/ui/parser/issue-14303-impl.stderr @@ -2,11 +2,7 @@ error: lifetime parameters must be declared prior to type parameters --> $DIR/issue-14303-impl.rs:3:13 | LL | impl<'a, T, 'b> X {} - | ^^ -help: move the lifetime parameter prior to the first type parameter - | -LL | impl<'a, 'b, T> X {} - | ^^^ -- + | --------^^- help: reorder the parameters: lifetimes, then types, then consts: `<'a, 'b, T>` error: aborting due to previous error diff --git a/src/test/ui/parser/issue-14303-path.rs b/src/test/ui/parser/issue-14303-path.rs index a08c89f3437b..386d19859e4a 100644 --- a/src/test/ui/parser/issue-14303-path.rs +++ b/src/test/ui/parser/issue-14303-path.rs @@ -8,6 +8,6 @@ mod foo { } fn bar<'a, 'b, 'c, T>(x: foo::X<'a, T, 'b, 'c>) {} -//~^ ERROR lifetime parameters must be declared prior to type parameters +//~^ ERROR lifetime arguments must be declared prior to type arguments fn main() {} diff --git a/src/test/ui/parser/issue-14303-path.stderr b/src/test/ui/parser/issue-14303-path.stderr index fb4fb32e11e5..19f2995ebee5 100644 --- a/src/test/ui/parser/issue-14303-path.stderr +++ b/src/test/ui/parser/issue-14303-path.stderr @@ -1,14 +1,8 @@ -error: lifetime parameters must be declared prior to type parameters +error: lifetime arguments must be declared prior to type arguments --> $DIR/issue-14303-path.rs:10:40 | LL | fn bar<'a, 'b, 'c, T>(x: foo::X<'a, T, 'b, 'c>) {} - | ^^ ^^ must be declared prior to type parameters - | | - | must be declared prior to type parameters -help: move the lifetime parameters prior to the first type parameter - | -LL | fn bar<'a, 'b, 'c, T>(x: foo::X<'a, 'b, 'c, T>) {} - | ^^^ ^^^ -- + | ^^ ^^ error: aborting due to previous error diff --git a/src/test/ui/parser/issue-14303-struct.stderr b/src/test/ui/parser/issue-14303-struct.stderr index 668b8d1de689..dbd0b987dd19 100644 --- a/src/test/ui/parser/issue-14303-struct.stderr +++ b/src/test/ui/parser/issue-14303-struct.stderr @@ -2,11 +2,7 @@ error: lifetime parameters must be declared prior to type parameters --> $DIR/issue-14303-struct.rs:1:17 | LL | struct X<'a, T, 'b> { - | ^^ -help: move the lifetime parameter prior to the first type parameter - | -LL | struct X<'a, 'b, T> { - | ^^^ -- + | --------^^- help: reorder the parameters: lifetimes, then types, then consts: `<'a, 'b, T>` error: aborting due to previous error diff --git a/src/test/ui/parser/issue-14303-trait.stderr b/src/test/ui/parser/issue-14303-trait.stderr index 11ce0c44351a..7dfa62d823fd 100644 --- a/src/test/ui/parser/issue-14303-trait.stderr +++ b/src/test/ui/parser/issue-14303-trait.stderr @@ -2,11 +2,7 @@ error: lifetime parameters must be declared prior to type parameters --> $DIR/issue-14303-trait.rs:1:18 | LL | trait Foo<'a, T, 'b> {} - | ^^ -help: move the lifetime parameter prior to the first type parameter - | -LL | trait Foo<'a, 'b, T> {} - | ^^^ -- + | --------^^- help: reorder the parameters: lifetimes, then types, then consts: `<'a, 'b, T>` error: aborting due to previous error diff --git a/src/test/ui/parser/issue-32214.rs b/src/test/ui/parser/issue-32214.rs index 7e55bc038e76..7191a3234c08 100644 --- a/src/test/ui/parser/issue-32214.rs +++ b/src/test/ui/parser/issue-32214.rs @@ -3,6 +3,6 @@ trait Trait { type Item; } pub fn test >() {} -//~^ ERROR type parameters must be declared prior to associated type bindings +//~^ ERROR associated type bindings must be declared after generic parameters fn main() { } diff --git a/src/test/ui/parser/issue-32214.stderr b/src/test/ui/parser/issue-32214.stderr index 660e517c85a1..7022019a22f2 100644 --- a/src/test/ui/parser/issue-32214.stderr +++ b/src/test/ui/parser/issue-32214.stderr @@ -1,12 +1,10 @@ -error: type parameters must be declared prior to associated type bindings - --> $DIR/issue-32214.rs:5:34 +error: associated type bindings must be declared after generic parameters + --> $DIR/issue-32214.rs:5:25 | LL | pub fn test >() {} - | ^ must be declared prior to associated type bindings -help: move the type parameter prior to the first associated type binding - | -LL | pub fn test >() {} - | ^^ -- + | -------^^^ + | | + | this associated type binding should be moved after the generic parameters error: aborting due to previous error diff --git a/src/test/ui/parser/removed-syntax-uniq-mut-ty.rs b/src/test/ui/parser/removed-syntax-uniq-mut-ty.rs index 12de76d9d6d9..79d51f5595d2 100644 --- a/src/test/ui/parser/removed-syntax-uniq-mut-ty.rs +++ b/src/test/ui/parser/removed-syntax-uniq-mut-ty.rs @@ -1 +1 @@ -type mut_box = Box; //~ ERROR expected one of `>`, lifetime, or type, found `mut` +type mut_box = Box; //~ ERROR expected one of `>`, const, lifetime, or type, found `mut` diff --git a/src/test/ui/parser/removed-syntax-uniq-mut-ty.stderr b/src/test/ui/parser/removed-syntax-uniq-mut-ty.stderr index 0177b19d74e7..b2759778d031 100644 --- a/src/test/ui/parser/removed-syntax-uniq-mut-ty.stderr +++ b/src/test/ui/parser/removed-syntax-uniq-mut-ty.stderr @@ -1,8 +1,8 @@ -error: expected one of `>`, lifetime, or type, found `mut` +error: expected one of `>`, const, lifetime, or type, found `mut` --> $DIR/removed-syntax-uniq-mut-ty.rs:1:20 | -LL | type mut_box = Box; //~ ERROR expected one of `>`, lifetime, or type, found `mut` - | ^^^ expected one of `>`, lifetime, or type here +LL | type mut_box = Box; //~ ERROR expected one of `>`, const, lifetime, or type, found `mut` + | ^^^ expected one of `>`, const, lifetime, or type here error: aborting due to previous error diff --git a/src/test/ui/rfc1598-generic-associated-types/empty_generics.rs b/src/test/ui/rfc1598-generic-associated-types/empty_generics.rs index 158ebc7d3888..afc27701920d 100644 --- a/src/test/ui/rfc1598-generic-associated-types/empty_generics.rs +++ b/src/test/ui/rfc1598-generic-associated-types/empty_generics.rs @@ -3,7 +3,7 @@ trait Foo { type Bar<,>; - //~^ ERROR expected one of `>`, identifier, or lifetime, found `,` + //~^ ERROR expected one of `>`, `const`, identifier, or lifetime, found `,` } fn main() {} diff --git a/src/test/ui/rfc1598-generic-associated-types/empty_generics.stderr b/src/test/ui/rfc1598-generic-associated-types/empty_generics.stderr index 2a01b2a3f0fa..5b98302924e3 100644 --- a/src/test/ui/rfc1598-generic-associated-types/empty_generics.stderr +++ b/src/test/ui/rfc1598-generic-associated-types/empty_generics.stderr @@ -1,8 +1,8 @@ -error: expected one of `>`, identifier, or lifetime, found `,` +error: expected one of `>`, `const`, identifier, or lifetime, found `,` --> $DIR/empty_generics.rs:5:14 | LL | type Bar<,>; - | ^ expected one of `>`, identifier, or lifetime here + | ^ expected one of `>`, `const`, identifier, or lifetime here warning: the feature `generic_associated_types` is incomplete and may cause the compiler to crash --> $DIR/empty_generics.rs:1:12 diff --git a/src/test/ui/suggestions/suggest-move-lifetimes.stderr b/src/test/ui/suggestions/suggest-move-lifetimes.stderr index b36e927b5c0c..2d6dee062166 100644 --- a/src/test/ui/suggestions/suggest-move-lifetimes.stderr +++ b/src/test/ui/suggestions/suggest-move-lifetimes.stderr @@ -2,41 +2,25 @@ error: lifetime parameters must be declared prior to type parameters --> $DIR/suggest-move-lifetimes.rs:1:13 | LL | struct A { //~ ERROR lifetime parameters must be declared - | ^^ -help: move the lifetime parameter prior to the first type parameter - | -LL | struct A<'a, T> { //~ ERROR lifetime parameters must be declared - | ^^^ -- + | ----^^- help: reorder the parameters: lifetimes, then types, then consts: `<'a, T>` error: lifetime parameters must be declared prior to type parameters --> $DIR/suggest-move-lifetimes.rs:5:13 | LL | struct B { //~ ERROR lifetime parameters must be declared - | ^^ -help: move the lifetime parameter prior to the first type parameter - | -LL | struct B<'a, T, U> { //~ ERROR lifetime parameters must be declared - | ^^^ -- + | ----^^---- help: reorder the parameters: lifetimes, then types, then consts: `<'a, T, U>` error: lifetime parameters must be declared prior to type parameters --> $DIR/suggest-move-lifetimes.rs:10:16 | LL | struct C { //~ ERROR lifetime parameters must be declared - | ^^ -help: move the lifetime parameter prior to the first type parameter - | -LL | struct C<'a, T, U> { //~ ERROR lifetime parameters must be declared - | ^^^ -- + | -------^^- help: reorder the parameters: lifetimes, then types, then consts: `<'a, T, U>` error: lifetime parameters must be declared prior to type parameters --> $DIR/suggest-move-lifetimes.rs:15:16 | LL | struct D { //~ ERROR lifetime parameters must be declared - | ^^ ^^ ^^ -help: move the lifetime parameter prior to the first type parameter - | -LL | struct D<'a, 'b, 'c, T, U, V> { //~ ERROR lifetime parameters must be declared - | ^^^ ^^^ ^^^ -- -- + | -------^^--^^-----^^- help: reorder the parameters: lifetimes, then types, then consts: `<'a, 'b, 'c, T, U, V>` error: aborting due to 4 previous errors diff --git a/src/test/ui/suggestions/suggest-move-types.rs b/src/test/ui/suggestions/suggest-move-types.rs index fd10ba4350c4..890950ea08c5 100644 --- a/src/test/ui/suggestions/suggest-move-types.rs +++ b/src/test/ui/suggestions/suggest-move-types.rs @@ -25,19 +25,20 @@ trait ThreeWithLifetime<'a, 'b, 'c, T, U, V> { type C; } -struct A> { //~ ERROR type parameters must be declared +struct A> { //~ ERROR associated type bindings must be declared after generic parameters m: M, t: T, } struct Al<'a, T, M: OneWithLifetime> { -//~^ ERROR generic arguments must declare lifetimes, types and associated type bindings in that order +//~^ ERROR associated type bindings must be declared after generic parameters +//~^^ ERROR lifetime arguments must be declared prior to type arguments m: M, t: &'a T, } -struct B> { //~ ERROR type parameters must be declared +struct B> { //~ ERROR associated type bindings must be declared after generic parameters m: M, t: T, u: U, @@ -45,14 +46,15 @@ struct B> { //~ ERROR type paramete } struct Bl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime> { -//~^ ERROR generic arguments must declare lifetimes, types and associated type bindings in that order +//~^ ERROR associated type bindings must be declared after generic parameters +//~^^ ERROR lifetime arguments must be declared prior to type arguments m: M, t: &'a T, u: &'b U, v: &'c V, } -struct C> { //~ ERROR type parameters must be declared +struct C> { //~ ERROR associated type bindings must be declared after generic parameters m: M, t: T, u: U, @@ -60,14 +62,15 @@ struct C> { //~ ERROR type paramete } struct Cl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime> { -//~^ ERROR generic arguments must declare lifetimes, types and associated type bindings in that order +//~^ ERROR associated type bindings must be declared after generic parameters +//~^^ ERROR lifetime arguments must be declared prior to type arguments m: M, t: &'a T, u: &'b U, v: &'c V, } -struct D> { //~ ERROR type parameters must be declared +struct D> { //~ ERROR associated type bindings must be declared after generic parameters m: M, t: T, u: U, @@ -75,7 +78,8 @@ struct D> { //~ ERROR type paramete } struct Dl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime> { -//~^ ERROR generic arguments must declare lifetimes, types and associated type bindings in that order +//~^ ERROR associated type bindings must be declared after generic parameters +//~^^ ERROR lifetime arguments must be declared prior to type arguments m: M, t: &'a T, u: &'b U, diff --git a/src/test/ui/suggestions/suggest-move-types.stderr b/src/test/ui/suggestions/suggest-move-types.stderr index 3643d9a91245..0901b71911d4 100644 --- a/src/test/ui/suggestions/suggest-move-types.stderr +++ b/src/test/ui/suggestions/suggest-move-types.stderr @@ -1,107 +1,102 @@ -error: type parameters must be declared prior to associated type bindings - --> $DIR/suggest-move-types.rs:28:26 +error: associated type bindings must be declared after generic parameters + --> $DIR/suggest-move-types.rs:28:20 | -LL | struct A> { //~ ERROR type parameters must be declared - | ^ must be declared prior to associated type bindings -help: move the type parameter prior to the first associated type binding - | -LL | struct A> { //~ ERROR type parameters must be declared - | ^^ -- +LL | struct A> { //~ ERROR associated type bindings must be declared after generic parameters + | ----^^^ + | | + | this associated type binding should be moved after the generic parameters -error: generic arguments must declare lifetimes, types and associated type bindings in that order +error: associated type bindings must be declared after generic parameters + --> $DIR/suggest-move-types.rs:34:37 + | +LL | struct Al<'a, T, M: OneWithLifetime> { + | ----^^^^^^^ + | | + | this associated type binding should be moved after the generic parameters + +error: associated type bindings must be declared after generic parameters + --> $DIR/suggest-move-types.rs:41:28 + | +LL | struct B> { //~ ERROR associated type bindings must be declared after generic parameters + | ----^^----^^----^^^^^^^^^ + | | | | + | | | this associated type binding should be moved after the generic parameters + | | this associated type binding should be moved after the generic parameters + | this associated type binding should be moved after the generic parameters + +error: associated type bindings must be declared after generic parameters + --> $DIR/suggest-move-types.rs:48:53 + | +LL | struct Bl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime> { + | ----^^----^^----^^^^^^^^^^^^^^^^^^^^^ + | | | | + | | | this associated type binding should be moved after the generic parameters + | | this associated type binding should be moved after the generic parameters + | this associated type binding should be moved after the generic parameters + +error: associated type bindings must be declared after generic parameters + --> $DIR/suggest-move-types.rs:57:28 + | +LL | struct C> { //~ ERROR associated type bindings must be declared after generic parameters + | ^^^----^^----^^----^^^^^^ + | | | | + | | | this associated type binding should be moved after the generic parameters + | | this associated type binding should be moved after the generic parameters + | this associated type binding should be moved after the generic parameters + +error: associated type bindings must be declared after generic parameters + --> $DIR/suggest-move-types.rs:64:53 + | +LL | struct Cl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime> { + | ^^^^^^^----^^----^^----^^^^^^^^^^^^^^ + | | | | + | | | this associated type binding should be moved after the generic parameters + | | this associated type binding should be moved after the generic parameters + | this associated type binding should be moved after the generic parameters + +error: associated type bindings must be declared after generic parameters + --> $DIR/suggest-move-types.rs:73:28 + | +LL | struct D> { //~ ERROR associated type bindings must be declared after generic parameters + | ^^^----^^----^^^^^----^^^ + | | | | + | | | this associated type binding should be moved after the generic parameters + | | this associated type binding should be moved after the generic parameters + | this associated type binding should be moved after the generic parameters + +error: associated type bindings must be declared after generic parameters + --> $DIR/suggest-move-types.rs:80:53 + | +LL | struct Dl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime> { + | ^^^^^^^----^^----^^^^^^^^^----^^^^^^^ + | | | | + | | | this associated type binding should be moved after the generic parameters + | | this associated type binding should be moved after the generic parameters + | this associated type binding should be moved after the generic parameters + +error: lifetime arguments must be declared prior to type arguments --> $DIR/suggest-move-types.rs:34:46 | LL | struct Al<'a, T, M: OneWithLifetime> { - | ^ ^^ must be declared prior to type parameters - | | - | must be declared prior to associated type bindings -help: move the parameters - | -LL | struct Al<'a, T, M: OneWithLifetime<'a, T, A=()>> { - | ^^^ ^^ -- + | ^^ -error: type parameters must be declared prior to associated type bindings - --> $DIR/suggest-move-types.rs:40:46 - | -LL | struct B> { //~ ERROR type parameters must be declared - | ^ ^ ^ must be declared prior to associated type bindings - | | | - | | must be declared prior to associated type bindings - | must be declared prior to associated type bindings -help: move the type parameters prior to the first associated type binding - | -LL | struct B> { //~ ERROR type parameters must be declared - | ^^ ^^ ^^ -- - -error: generic arguments must declare lifetimes, types and associated type bindings in that order - --> $DIR/suggest-move-types.rs:47:80 +error: lifetime arguments must be declared prior to type arguments + --> $DIR/suggest-move-types.rs:48:80 | LL | struct Bl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime> { - | ^ ^ ^ ^^ ^^ ^^ must be declared prior to type parameters - | | | | | | - | | | | | must be declared prior to type parameters - | | | | must be declared prior to type parameters - | | | must be declared prior to associated type bindings - | | must be declared prior to associated type bindings - | must be declared prior to associated type bindings -help: move the parameters - | -LL | struct Bl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<'a, 'b, 'c, T, U, V, A=(), B=(), C=()>> { - | ^^^ ^^^ ^^^ ^^ ^^ ^^ -- + | ^^ ^^ ^^ -error: type parameters must be declared prior to associated type bindings - --> $DIR/suggest-move-types.rs:55:49 - | -LL | struct C> { //~ ERROR type parameters must be declared - | ^ ^ must be declared prior to associated type bindings - | | - | must be declared prior to associated type bindings -help: move the type parameters prior to the first associated type binding - | -LL | struct C> { //~ ERROR type parameters must be declared - | ^^ ^^ -- - -error: generic arguments must declare lifetimes, types and associated type bindings in that order - --> $DIR/suggest-move-types.rs:62:56 +error: lifetime arguments must be declared prior to type arguments + --> $DIR/suggest-move-types.rs:64:56 | LL | struct Cl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime> { - | ^^ ^ ^^ ^ ^^ must be declared prior to type parameters - | | | | | - | | | | must be declared prior to associated type bindings - | | | must be declared prior to type parameters - | | must be declared prior to associated type bindings - | must be declared prior to type parameters -help: move the parameters - | -LL | struct Cl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<'a, 'b, 'c, T, U, V, A=(), B=(), C=()>> { - | ^^^ ^^^ ^^^ -- ^^ ^^ -- + | ^^ ^^ ^^ -error: type parameters must be declared prior to associated type bindings - --> $DIR/suggest-move-types.rs:70:43 - | -LL | struct D> { //~ ERROR type parameters must be declared - | ^ ^ must be declared prior to associated type bindings - | | - | must be declared prior to associated type bindings -help: move the type parameters prior to the first associated type binding - | -LL | struct D> { //~ ERROR type parameters must be declared - | ^^ ^^ -- -- - -error: generic arguments must declare lifetimes, types and associated type bindings in that order - --> $DIR/suggest-move-types.rs:77:56 +error: lifetime arguments must be declared prior to type arguments + --> $DIR/suggest-move-types.rs:80:56 | LL | struct Dl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime> { - | ^^ ^ ^^ ^ ^^ must be declared prior to type parameters - | | | | | - | | | | must be declared prior to associated type bindings - | | | must be declared prior to type parameters - | | must be declared prior to associated type bindings - | must be declared prior to type parameters -help: move the parameters - | -LL | struct Dl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<'a, 'b, 'c, T, U, V, A=(), B=(), C=()>> { - | ^^^ ^^^ ^^^ -- ^^ ^^ -- -- + | ^^ ^^ ^^ -error: aborting due to 8 previous errors +error: aborting due to 12 previous errors diff --git a/src/test/ui/traits/trait-object-vs-lifetime.rs b/src/test/ui/traits/trait-object-vs-lifetime.rs index a12429c868ed..36dec21be052 100644 --- a/src/test/ui/traits/trait-object-vs-lifetime.rs +++ b/src/test/ui/traits/trait-object-vs-lifetime.rs @@ -12,6 +12,6 @@ fn main() { //~^ ERROR wrong number of lifetime arguments: expected 1, found 2 //~| ERROR wrong number of type arguments: expected 1, found 0 let _: S<'static +, 'static>; - //~^ ERROR lifetime parameters must be declared prior to type parameters + //~^ ERROR lifetime arguments must be declared prior to type arguments //~| ERROR at least one non-builtin trait is required for an object type } diff --git a/src/test/ui/traits/trait-object-vs-lifetime.stderr b/src/test/ui/traits/trait-object-vs-lifetime.stderr index 4cc96bae5cd1..e0c52a72a093 100644 --- a/src/test/ui/traits/trait-object-vs-lifetime.stderr +++ b/src/test/ui/traits/trait-object-vs-lifetime.stderr @@ -1,12 +1,8 @@ -error: lifetime parameters must be declared prior to type parameters +error: lifetime arguments must be declared prior to type arguments --> $DIR/trait-object-vs-lifetime.rs:14:25 | LL | let _: S<'static +, 'static>; - | ^^^^^^^ must be declared prior to type parameters -help: move the lifetime parameter prior to the first type parameter - | -LL | let _: S<'static, 'static +>; - | ^^^^^^^^ -- + | ^^^^^^^ error[E0224]: at least one non-builtin trait is required for an object type --> $DIR/trait-object-vs-lifetime.rs:9:23