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