]> git.lizzy.rs Git - rust.git/blob - tests/ui/error-codes/E0107.rs
Auto merge of #101138 - Rejyr:diagnostic-migration-rustc-lint-pt2, r=davidtwco
[rust.git] / tests / ui / error-codes / E0107.rs
1 struct Foo<'a>(&'a str);
2 struct Buzz<'a, 'b>(&'a str, &'b str);
3 struct Qux<'a, T>(&'a T);
4 struct Quux<T>(T);
5
6 enum Bar {
7     A,
8     B,
9     C,
10 }
11
12 struct Baz<'a, 'b, 'c> {
13     buzz: Buzz<'a>,
14     //~^ ERROR this struct takes 2 lifetime arguments
15     //~| HELP add missing lifetime argument
16
17     bar: Bar<'a>,
18     //~^ ERROR this enum takes 0 lifetime arguments
19     //~| HELP remove these generics
20
21     foo2: Foo<'a, 'b, 'c>,
22     //~^ ERROR this struct takes 1 lifetime argument
23     //~| HELP remove these lifetime arguments
24
25     qux1: Qux<'a, 'b, i32>,
26     //~^ ERROR this struct takes 1 lifetime argument
27     //~| HELP remove this lifetime argument
28
29     qux2: Qux<'a, i32, 'b>,
30     //~^ ERROR this struct takes 1 lifetime argument
31     //~| HELP remove this lifetime argument
32
33     qux3: Qux<'a, 'b, 'c, i32>,
34     //~^ ERROR this struct takes 1 lifetime argument
35     //~| HELP remove these lifetime arguments
36
37     qux4: Qux<'a, i32, 'b, 'c>,
38     //~^ ERROR this struct takes 1 lifetime argument
39     //~| HELP remove these lifetime arguments
40
41     qux5: Qux<'a, 'b, i32, 'c>,
42     //~^ ERROR this struct takes 1 lifetime argument
43     //~| HELP remove this lifetime argument
44
45     quux: Quux<'a, i32, 'b>,
46     //~^ ERROR this struct takes 0 lifetime arguments
47     //~| HELP remove this lifetime argument
48 }
49
50 pub trait T {
51     type A;
52     type B;
53 }
54
55 fn trait_bound_generic<I: T<u8, u16>>(_i: I) {
56     //~^ ERROR this trait takes 0 generic arguments
57     //~| HELP replace the generic bounds with the associated types
58 }
59
60 fn main() {}