diff options
| author | varkor <github@varkor.com> | 2019-02-05 17:00:19 +0100 |
|---|---|---|
| committer | varkor <github@varkor.com> | 2019-02-07 15:02:17 +0100 |
| commit | 455d659e91c6e7b0b9eee15066e85180b9ade584 (patch) | |
| tree | 04e7408cbf14c7a8500c282a9940e2d4afc35cd2 | |
| parent | 8fd597900629b215e858eebcfb24ab542364cc0e (diff) | |
| download | rust-455d659e91c6e7b0b9eee15066e85180b9ade584.tar.gz rust-455d659e91c6e7b0b9eee15066e85180b9ade584.zip | |
Update tests
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
45 files changed, 182 insertions, 257 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 d7feb038530..2ef5f13f3d4 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 c4c0cee5ccc..97c0a19a3da 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 f9db6a5f72a..f58ddd5fbda 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 9099d74ce1b..ff7ced77f25 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 e9f908d479f..44a7c9d7c8b 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>(_: 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 452f0ea5e17..b383e21e161 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 41750d4bb36..17d48edc35c 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<T,T> = Option<T>; @@ -6,7 +6,7 @@ LL | type Foo<T,T> = Option<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:4:14 | LL | struct Bar<T,T>(T); @@ -14,7 +14,7 @@ LL | struct Bar<T,T>(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<T,T> { @@ -22,7 +22,7 @@ LL | struct Baz<T,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:12:12 | LL | enum Boo<T,T> { @@ -30,7 +30,7 @@ LL | enum Boo<T,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:18:11 | LL | fn quux<T,T>(x: T) {} @@ -38,7 +38,7 @@ LL | fn quux<T,T>(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<T,T> {} @@ -46,7 +46,7 @@ LL | trait Qux<T,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:24:8 | LL | impl<T,T> Qux<T,T> for Option<T> {} diff --git a/src/test/ui/error-codes/E0403.stderr b/src/test/ui/error-codes/E0403.stderr index 919a82dbe1a..b9246475029 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<T, T>(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 e84506ee249..9f983f74f5b 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<T> = Box<T,,>; //~ error: expected one of `>`, identifier, lifetime, or type, found `,` +type Type_3<T> = Box<T,,>; //~ error: expected one of `>`, const, identifier, lifetime, or type, found `,` //type Type_4<T> = 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 5247298b7cc..e8edb5ba70f 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<T> = Box<T,,>; //~ error: expected one of `>`, identifier, lifetime, or type, found `,` - | ^ expected one of `>`, identifier, lifetime, or type here +LL | type Type_3<T> = Box<T,,>; //~ 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 785a6fa7d9a..e9a34a04667 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<T> = 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 74c38d9e97d..22a655465e8 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<T> = 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 71dcc1f3a02..23862516d2c 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 38457beadc4..d83fc41f43e 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 da32da48852..dc327f3f788 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 55b1d031a39..0740df59523 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 feaaff2c890..277b4524506 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 8b5f67c703f..c1422d849fc 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 2fc7243559a..756119e0127 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<T,,> = Box<T>; // 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 cdeb544f07c..cfe3ec57712 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 b14a5b0ff36..6074fbb2204 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<T,,> = Box<T>; //~ error: expected one of `>`, identifier, or lifetime, found `,` +type Type_9<T,,> = Box<T>; //~ 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 dfe705c6f12..960e8c8c086 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<T,,> = Box<T>; //~ error: expected one of `>`, identifier, or lifetime, found `,` - | ^ expected one of `>`, identifier, or lifetime here +LL | type Type_9<T,,> = Box<T>; //~ 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 7ac8dffdfbe..3cef5db66c6 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<T, 'a, 'b>() {} - | ^^ ^^ -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<T, U, 'a>() {} - | ^^ -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 89a969bb2e2..9225cfce94e 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 f39e5beb6ac..191ea3ebd07 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 a31429e7228..bcecd75b1ab 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 4582aeef428..082c37e0be7 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 17b9b766b21..39694198cdb 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::<Vec<S<_, 'a>>>(); - //~^ 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 2a736491594..8ef9f1a1a6c 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::<Vec<S<_, 'a>>>(); - | ^^ must be declared prior to type parameters -help: move the lifetime parameter prior to the first type parameter - | -LL | .collect::<Vec<S<'a, _>>>(); - | ^^^ -- + | ^^ 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 a1953396153..3b5615d2a9e 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<T> {} - | ^^ -help: move the lifetime parameter prior to the first type parameter - | -LL | impl<'a, 'b, T> X<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-path.rs b/src/test/ui/parser/issue-14303-path.rs index a08c89f3437..386d19859e4 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 fb4fb32e11e..19f2995ebee 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 668b8d1de68..dbd0b987dd1 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 11ce0c44351..7dfa62d823f 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 7e55bc038e7..7191a3234c0 100644 --- a/src/test/ui/parser/issue-32214.rs +++ b/src/test/ui/parser/issue-32214.rs @@ -3,6 +3,6 @@ trait Trait<T> { type Item; } pub fn test<W, I: Trait<Item=(), W> >() {} -//~^ 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 660e517c85a..7022019a22f 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<W, I: Trait<Item=(), W> >() {} - | ^ must be declared prior to associated type bindings -help: move the type parameter prior to the first associated type binding - | -LL | pub fn test<W, I: Trait<W, Item=()> >() {} - | ^^ -- + | -------^^^ + | | + | 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 12de76d9d6d..79d51f5595d 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<mut isize>; //~ ERROR expected one of `>`, lifetime, or type, found `mut` +type mut_box = Box<mut isize>; //~ 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 0177b19d74e..b2759778d03 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<mut isize>; //~ ERROR expected one of `>`, lifetime, or type, found `mut` - | ^^^ expected one of `>`, lifetime, or type here +LL | type mut_box = Box<mut isize>; //~ 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 158ebc7d388..afc27701920 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 2a01b2a3f0f..5b98302924e 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 b36e927b5c0..2d6dee06216 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<T, '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<T, 'a, U> { //~ 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<T, U, 'a> { //~ 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<T, U, 'a, 'b, V, 'c> { //~ 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 fd10ba4350c..890950ea08c 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<T, M: One<A=(), T>> { //~ ERROR type parameters must be declared +struct A<T, M: One<A=(), T>> { //~ ERROR associated type bindings must be declared after generic parameters m: M, t: T, } struct Al<'a, T, M: OneWithLifetime<A=(), T, 'a>> { -//~^ 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<T, U, V, M: Three<A=(), B=(), C=(), T, U, V>> { //~ ERROR type parameters must be declared +struct B<T, U, V, M: Three<A=(), B=(), C=(), T, U, V>> { //~ ERROR associated type bindings must be declared after generic parameters m: M, t: T, u: U, @@ -45,14 +46,15 @@ struct B<T, U, V, M: Three<A=(), B=(), C=(), T, U, V>> { //~ ERROR type paramete } struct Bl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<A=(), B=(), C=(), T, U, V, 'a, 'b, 'c>> { -//~^ 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<T, U, V, M: Three<T, A=(), B=(), C=(), U, V>> { //~ ERROR type parameters must be declared +struct C<T, U, V, M: Three<T, A=(), B=(), C=(), U, V>> { //~ ERROR associated type bindings must be declared after generic parameters m: M, t: T, u: U, @@ -60,14 +62,15 @@ struct C<T, U, V, M: Three<T, A=(), B=(), C=(), U, V>> { //~ ERROR type paramete } struct Cl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<T, 'a, A=(), B=(), C=(), U, 'b, V, 'c>> { -//~^ 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<T, U, V, M: Three<T, A=(), B=(), U, C=(), V>> { //~ ERROR type parameters must be declared +struct D<T, U, V, M: Three<T, A=(), B=(), U, C=(), V>> { //~ ERROR associated type bindings must be declared after generic parameters m: M, t: T, u: U, @@ -75,7 +78,8 @@ struct D<T, U, V, M: Three<T, A=(), B=(), U, C=(), V>> { //~ ERROR type paramete } struct Dl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<T, 'a, A=(), B=(), U, 'b, C=(), V, 'c>> { -//~^ 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 3643d9a9124..0901b71911d 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<T, M: One<A=(), T>> { //~ 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<T, M: One<T, A=()>> { //~ ERROR type parameters must be declared - | ^^ -- +LL | struct A<T, M: One<A=(), T>> { //~ 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 - --> $DIR/suggest-move-types.rs:34:46 +error: associated type bindings must be declared after generic parameters + --> $DIR/suggest-move-types.rs:34:37 | LL | struct Al<'a, T, M: OneWithLifetime<A=(), T, 'a>> { - | ^ ^^ 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=()>> { - | ^^^ ^^ -- + | ----^^^^^^^ + | | + | this associated type binding should be moved after the generic parameters -error: type parameters must be declared prior to associated type bindings - --> $DIR/suggest-move-types.rs:40:46 - | -LL | struct B<T, U, V, M: Three<A=(), B=(), C=(), T, U, V>> { //~ 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<T, U, V, M: Three<T, U, V, A=(), B=(), C=()>> { //~ ERROR type parameters must be declared - | ^^ ^^ ^^ -- +error: associated type bindings must be declared after generic parameters + --> $DIR/suggest-move-types.rs:41:28 + | +LL | struct B<T, U, V, M: Three<A=(), B=(), C=(), T, U, V>> { //~ 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: generic arguments must declare lifetimes, types and associated type bindings in that order - --> $DIR/suggest-move-types.rs:47:80 +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<A=(), B=(), C=(), T, U, V, 'a, 'b, 'c>> { - | ^ ^ ^ ^^ ^^ ^^ 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=()>> { - | ^^^ ^^^ ^^^ ^^ ^^ ^^ -- + | ----^^----^^----^^^^^^^^^^^^^^^^^^^^^ + | | | | + | | | 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: type parameters must be declared prior to associated type bindings - --> $DIR/suggest-move-types.rs:55:49 - | -LL | struct C<T, U, V, M: Three<T, A=(), B=(), C=(), U, V>> { //~ 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<T, U, V, M: Three<T, U, V, A=(), B=(), C=()>> { //~ ERROR type parameters must be declared - | ^^ ^^ -- +error: associated type bindings must be declared after generic parameters + --> $DIR/suggest-move-types.rs:57:28 + | +LL | struct C<T, U, V, M: Three<T, A=(), B=(), C=(), U, V>> { //~ 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: generic arguments must declare lifetimes, types and associated type bindings in that order - --> $DIR/suggest-move-types.rs:62:56 +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<T, 'a, A=(), B=(), C=(), U, 'b, V, 'c>> { - | ^^ ^ ^^ ^ ^^ 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 + | ^^^^^^^----^^----^^----^^^^^^^^^^^^^^ + | | | | + | | | 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<T, U, V, M: Three<T, A=(), B=(), U, C=(), V>> { //~ 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 Cl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<'a, 'b, 'c, T, U, V, A=(), B=(), C=()>> { - | ^^^ ^^^ ^^^ -- ^^ ^^ -- +LL | struct Dl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<T, 'a, A=(), B=(), U, 'b, C=(), V, 'c>> { + | ^^^^^^^----^^----^^^^^^^^^----^^^^^^^ + | | | | + | | | 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: type parameters must be declared prior to associated type bindings - --> $DIR/suggest-move-types.rs:70:43 +error: lifetime arguments must be declared prior to type arguments + --> $DIR/suggest-move-types.rs:34:46 | -LL | struct D<T, U, V, M: Three<T, A=(), B=(), U, C=(), V>> { //~ 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 Al<'a, T, M: OneWithLifetime<A=(), T, 'a>> { + | ^^ + +error: lifetime arguments must be declared prior to type arguments + --> $DIR/suggest-move-types.rs:48:80 | -LL | struct D<T, U, V, M: Three<T, U, V, A=(), B=(), C=()>> { //~ ERROR type parameters must be declared - | ^^ ^^ -- -- +LL | struct Bl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<A=(), B=(), C=(), T, U, V, 'a, 'b, 'c>> { + | ^^ ^^ ^^ -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:64:56 | -LL | struct Dl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<T, 'a, A=(), B=(), U, 'b, C=(), V, 'c>> { - | ^^ ^ ^^ ^ ^^ 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<T, 'a, A=(), B=(), C=(), U, 'b, V, 'c>> { + | ^^ ^^ ^^ + +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<'a, 'b, 'c, T, U, V, A=(), B=(), C=()>> { - | ^^^ ^^^ ^^^ -- ^^ ^^ -- -- +LL | struct Dl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<T, 'a, A=(), B=(), U, 'b, C=(), V, '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 a12429c868e..36dec21be05 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 4cc96bae5cd..e0c52a72a09 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 |
