rust/tests/ui/parser/issues/issue-14303.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

34 lines
851 B
Rust
Raw Normal View History

2022-09-08 08:56:32 -05:00
enum Enum<'a, T, 'b> {
2022-09-09 07:28:57 -05:00
//~^ ERROR lifetime parameters must be declared prior to type and const parameters
2022-09-08 08:56:32 -05:00
A(&'a &'b T)
}
struct Struct<'a, T, 'b> {
2022-09-09 07:28:57 -05:00
//~^ ERROR lifetime parameters must be declared prior to type and const parameters
2022-09-08 08:56:32 -05:00
x: &'a &'b T
}
trait Trait<'a, T, 'b> {}
2022-09-09 07:28:57 -05:00
//~^ ERROR lifetime parameters must be declared prior to type and const parameters
2022-09-08 08:56:32 -05:00
fn foo<'a, T, 'b>(x: &'a T) {}
2022-09-09 07:28:57 -05:00
//~^ ERROR lifetime parameters must be declared prior to type and const parameters
2022-09-08 08:56:32 -05:00
struct Y<T>(T);
impl<'a, T, 'b> Y<T> {}
2022-09-09 07:28:57 -05:00
//~^ ERROR lifetime parameters must be declared prior to type and const parameters
2022-09-08 08:56:32 -05:00
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() {}