2016-05-25 11:58:07 +00:00
|
|
|
struct Foo<'a>(&'a str);
|
2016-08-05 17:56:10 +00:00
|
|
|
struct Buzz<'a, 'b>(&'a str, &'b str);
|
2021-05-16 14:54:14 +00:00
|
|
|
struct Qux<'a, T>(&'a T);
|
|
|
|
struct Quux<T>(T);
|
2016-05-25 11:58:07 +00:00
|
|
|
|
|
|
|
enum Bar {
|
|
|
|
A,
|
|
|
|
B,
|
|
|
|
C,
|
|
|
|
}
|
|
|
|
|
2016-08-05 17:56:10 +00:00
|
|
|
struct Baz<'a, 'b, 'c> {
|
|
|
|
buzz: Buzz<'a>,
|
2023-02-23 17:27:06 +00:00
|
|
|
//~^ ERROR struct takes 2 lifetime arguments
|
2021-01-02 18:45:11 +00:00
|
|
|
//~| HELP add missing lifetime argument
|
|
|
|
|
2016-08-05 15:54:04 +00:00
|
|
|
bar: Bar<'a>,
|
2023-02-23 17:27:06 +00:00
|
|
|
//~^ ERROR enum takes 0 lifetime arguments
|
2024-07-05 01:28:24 +00:00
|
|
|
//~| HELP remove the unnecessary generics
|
2021-01-02 18:45:11 +00:00
|
|
|
|
2016-08-05 17:56:10 +00:00
|
|
|
foo2: Foo<'a, 'b, 'c>,
|
2023-02-23 17:27:06 +00:00
|
|
|
//~^ ERROR struct takes 1 lifetime argument
|
2024-07-05 01:28:24 +00:00
|
|
|
//~| HELP remove the lifetime arguments
|
2021-05-16 14:54:14 +00:00
|
|
|
|
|
|
|
qux1: Qux<'a, 'b, i32>,
|
2023-02-23 17:27:06 +00:00
|
|
|
//~^ ERROR struct takes 1 lifetime argument
|
2024-07-05 01:28:24 +00:00
|
|
|
//~| HELP remove the lifetime argument
|
2021-05-16 14:54:14 +00:00
|
|
|
|
|
|
|
qux2: Qux<'a, i32, 'b>,
|
2023-02-23 17:27:06 +00:00
|
|
|
//~^ ERROR struct takes 1 lifetime argument
|
2024-07-05 01:28:24 +00:00
|
|
|
//~| HELP remove the lifetime argument
|
2021-05-16 14:54:14 +00:00
|
|
|
|
|
|
|
qux3: Qux<'a, 'b, 'c, i32>,
|
2023-02-23 17:27:06 +00:00
|
|
|
//~^ ERROR struct takes 1 lifetime argument
|
2024-07-05 01:28:24 +00:00
|
|
|
//~| HELP remove the lifetime arguments
|
2021-05-16 14:54:14 +00:00
|
|
|
|
|
|
|
qux4: Qux<'a, i32, 'b, 'c>,
|
2023-02-23 17:27:06 +00:00
|
|
|
//~^ ERROR struct takes 1 lifetime argument
|
2024-07-05 01:28:24 +00:00
|
|
|
//~| HELP remove the lifetime arguments
|
2021-05-16 14:54:14 +00:00
|
|
|
|
|
|
|
qux5: Qux<'a, 'b, i32, 'c>,
|
2023-02-23 17:27:06 +00:00
|
|
|
//~^ ERROR struct takes 1 lifetime argument
|
2024-07-05 01:28:24 +00:00
|
|
|
//~| HELP remove the lifetime argument
|
2021-05-16 14:54:14 +00:00
|
|
|
|
|
|
|
quux: Quux<'a, i32, 'b>,
|
2023-02-23 17:27:06 +00:00
|
|
|
//~^ ERROR struct takes 0 lifetime arguments
|
2024-07-05 01:28:24 +00:00
|
|
|
//~| HELP remove the lifetime argument
|
2016-05-25 11:58:07 +00:00
|
|
|
}
|
|
|
|
|
2022-03-27 18:45:08 +00:00
|
|
|
pub trait T {
|
|
|
|
type A;
|
|
|
|
type B;
|
|
|
|
}
|
|
|
|
|
|
|
|
fn trait_bound_generic<I: T<u8, u16>>(_i: I) {
|
2023-02-23 17:27:06 +00:00
|
|
|
//~^ ERROR trait takes 0 generic arguments
|
2022-03-27 18:45:08 +00:00
|
|
|
//~| HELP replace the generic bounds with the associated types
|
|
|
|
}
|
|
|
|
|
2018-07-24 01:59:22 +00:00
|
|
|
fn main() {}
|