Update tests

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
This commit is contained in:
varkor 2019-02-05 17:00:19 +01:00
parent 8fd5979006
commit 455d659e91
45 changed files with 187 additions and 262 deletions

View File

@ -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() {

View File

@ -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> {

View File

@ -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() {}

View File

@ -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> {}

View File

@ -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() {}

View File

@ -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

View File

@ -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> {}

View File

@ -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

View File

@ -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 `,`

View File

@ -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

View File

@ -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, ()>;

View File

@ -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

View File

@ -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 `,`

View File

@ -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

View File

@ -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 `,`

View File

@ -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

View File

@ -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 `,`

View File

@ -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

View File

@ -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 `,`

View File

@ -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

View File

@ -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 `,`

View File

@ -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

View File

@ -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`
|

View File

@ -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() {}

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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() {}

View File

@ -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

View File

@ -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

View File

@ -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() {}

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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() { }

View File

@ -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

View File

@ -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`

View File

@ -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

View File

@ -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() {}

View File

@ -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

View File

@ -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

View File

@ -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,

View File

@ -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
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>> {
| ----^^^^^^^
| |
| 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<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: 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>> {
| ----^^----^^----^^^^^^^^^^^^^^^^^^^^^
| | | |
| | | 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<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: 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>> {
| ^^^^^^^----^^----^^----^^^^^^^^^^^^^^
| | | |
| | | 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 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: lifetime arguments must be declared prior to type arguments
--> $DIR/suggest-move-types.rs:34:46
|
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=()>> {
| ^^^ ^^ --
| ^^
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: 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<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=()>> {
| ^^^ ^^^ ^^^ ^^ ^^ ^^ --
| ^^ ^^ ^^
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: 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<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
|
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<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 D<T, U, V, M: Three<T, U, V, A=(), B=(), 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: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<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 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

View File

@ -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
}

View File

@ -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