merge tests
This commit is contained in:
parent
dcf30047de
commit
4c75b32e99
14 changed files with 72 additions and 88 deletions
|
@ -1,6 +0,0 @@
|
|||
enum X<'a, T, 'b> {
|
||||
//~^ ERROR lifetime parameters must be declared prior to type or const parameters
|
||||
A(&'a &'b T)
|
||||
}
|
||||
|
||||
fn main() {}
|
|
@ -1,8 +0,0 @@
|
|||
error: lifetime parameters must be declared prior to type or const parameters
|
||||
--> $DIR/issue-14303-enum.rs:1:15
|
||||
|
|
||||
LL | enum X<'a, T, 'b> {
|
||||
| --------^^- help: reorder the parameters: lifetimes, then consts and types: `<'a, 'b, T>`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
fn foo<'a, T, 'b>(x: &'a T) {}
|
||||
//~^ ERROR lifetime parameters must be declared prior to type or const parameters
|
||||
|
||||
fn main() {}
|
|
@ -1,8 +0,0 @@
|
|||
error: lifetime parameters must be declared prior to type or const parameters
|
||||
--> $DIR/issue-14303-fn-def.rs:1:15
|
||||
|
|
||||
LL | fn foo<'a, T, 'b>(x: &'a T) {}
|
||||
| --------^^- help: reorder the parameters: lifetimes, then consts and types: `<'a, 'b, T>`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
struct X<T>(T);
|
||||
|
||||
impl<'a, T, 'b> X<T> {}
|
||||
//~^ ERROR lifetime parameters must be declared prior to type or const parameters
|
||||
|
||||
fn main() {}
|
|
@ -1,8 +0,0 @@
|
|||
error: lifetime parameters must be declared prior to type or const parameters
|
||||
--> $DIR/issue-14303-impl.rs:3:13
|
||||
|
|
||||
LL | impl<'a, T, 'b> X<T> {}
|
||||
| --------^^- help: reorder the parameters: lifetimes, then consts and types: `<'a, 'b, T>`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
mod foo {
|
||||
pub struct X<'a, 'b, 'c, T> {
|
||||
a: &'a str,
|
||||
b: &'b str,
|
||||
c: &'c str,
|
||||
t: T,
|
||||
}
|
||||
}
|
||||
|
||||
fn bar<'a, 'b, 'c, T>(x: foo::X<'a, T, 'b, 'c>) {}
|
||||
//~^ ERROR type provided when a lifetime was expected
|
||||
|
||||
fn main() {}
|
|
@ -1,9 +0,0 @@
|
|||
error[E0747]: type provided when a lifetime was expected
|
||||
--> $DIR/issue-14303-path.rs:10:37
|
||||
|
|
||||
LL | fn bar<'a, 'b, 'c, T>(x: foo::X<'a, T, 'b, 'c>) {}
|
||||
| ^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0747`.
|
|
@ -1,6 +0,0 @@
|
|||
struct X<'a, T, 'b> {
|
||||
//~^ ERROR lifetime parameters must be declared prior to type or const parameters
|
||||
x: &'a &'b T
|
||||
}
|
||||
|
||||
fn main() {}
|
|
@ -1,8 +0,0 @@
|
|||
error: lifetime parameters must be declared prior to type or const parameters
|
||||
--> $DIR/issue-14303-struct.rs:1:17
|
||||
|
|
||||
LL | struct X<'a, T, 'b> {
|
||||
| --------^^- help: reorder the parameters: lifetimes, then consts and types: `<'a, 'b, T>`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
trait Foo<'a, T, 'b> {}
|
||||
//~^ ERROR lifetime parameters must be declared prior to type or const parameters
|
||||
|
||||
fn main() {}
|
|
@ -1,8 +0,0 @@
|
|||
error: lifetime parameters must be declared prior to type or const parameters
|
||||
--> $DIR/issue-14303-trait.rs:1:18
|
||||
|
|
||||
LL | trait Foo<'a, T, 'b> {}
|
||||
| --------^^- help: reorder the parameters: lifetimes, then consts and types: `<'a, 'b, T>`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
33
src/test/ui/parser/issues/issue-14303.rs
Normal file
33
src/test/ui/parser/issues/issue-14303.rs
Normal file
|
@ -0,0 +1,33 @@
|
|||
enum Enum<'a, T, 'b> {
|
||||
//~^ ERROR lifetime parameters must be declared prior to type or const parameters
|
||||
A(&'a &'b T)
|
||||
}
|
||||
|
||||
struct Struct<'a, T, 'b> {
|
||||
//~^ ERROR lifetime parameters must be declared prior to type or const parameters
|
||||
x: &'a &'b T
|
||||
}
|
||||
|
||||
trait Trait<'a, T, 'b> {}
|
||||
//~^ ERROR lifetime parameters must be declared prior to type or const parameters
|
||||
|
||||
fn foo<'a, T, 'b>(x: &'a T) {}
|
||||
//~^ ERROR lifetime parameters must be declared prior to type or const parameters
|
||||
|
||||
struct Y<T>(T);
|
||||
impl<'a, T, 'b> Y<T> {}
|
||||
//~^ ERROR lifetime parameters must be declared prior to type or const parameters
|
||||
|
||||
mod bar {
|
||||
pub struct X<'a, 'b, 'c, T> {
|
||||
a: &'a str,
|
||||
b: &'b str,
|
||||
c: &'c str,
|
||||
t: T,
|
||||
}
|
||||
}
|
||||
|
||||
fn bar<'a, 'b, 'c, T>(x: bar::X<'a, T, 'b, 'c>) {}
|
||||
//~^ ERROR type provided when a lifetime was expected
|
||||
|
||||
fn main() {}
|
39
src/test/ui/parser/issues/issue-14303.stderr
Normal file
39
src/test/ui/parser/issues/issue-14303.stderr
Normal file
|
@ -0,0 +1,39 @@
|
|||
error: lifetime parameters must be declared prior to type or const parameters
|
||||
--> $DIR/issue-14303.rs:1:18
|
||||
|
|
||||
LL | enum Enum<'a, T, 'b> {
|
||||
| --------^^- help: reorder the parameters: lifetimes, then consts and types: `<'a, 'b, T>`
|
||||
|
||||
error: lifetime parameters must be declared prior to type or const parameters
|
||||
--> $DIR/issue-14303.rs:6:22
|
||||
|
|
||||
LL | struct Struct<'a, T, 'b> {
|
||||
| --------^^- help: reorder the parameters: lifetimes, then consts and types: `<'a, 'b, T>`
|
||||
|
||||
error: lifetime parameters must be declared prior to type or const parameters
|
||||
--> $DIR/issue-14303.rs:11:20
|
||||
|
|
||||
LL | trait Trait<'a, T, 'b> {}
|
||||
| --------^^- help: reorder the parameters: lifetimes, then consts and types: `<'a, 'b, T>`
|
||||
|
||||
error: lifetime parameters must be declared prior to type or const parameters
|
||||
--> $DIR/issue-14303.rs:14:15
|
||||
|
|
||||
LL | fn foo<'a, T, 'b>(x: &'a T) {}
|
||||
| --------^^- help: reorder the parameters: lifetimes, then consts and types: `<'a, 'b, T>`
|
||||
|
||||
error: lifetime parameters must be declared prior to type or const parameters
|
||||
--> $DIR/issue-14303.rs:18:13
|
||||
|
|
||||
LL | impl<'a, T, 'b> Y<T> {}
|
||||
| --------^^- help: reorder the parameters: lifetimes, then consts and types: `<'a, 'b, T>`
|
||||
|
||||
error[E0747]: type provided when a lifetime was expected
|
||||
--> $DIR/issue-14303.rs:30:37
|
||||
|
|
||||
LL | fn bar<'a, 'b, 'c, T>(x: bar::X<'a, T, 'b, 'c>) {}
|
||||
| ^
|
||||
|
||||
error: aborting due to 6 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0747`.
|
Loading…
Add table
Add a link
Reference in a new issue