]> git.lizzy.rs Git - rust.git/blob - tests/ui/object-lifetime/object-lifetime-default.rs
Rollup merge of #106670 - albertlarsan68:check-docs-in-pr-ci, r=Mark-Simulacrum
[rust.git] / tests / ui / object-lifetime / object-lifetime-default.rs
1 #![feature(rustc_attrs)]
2
3 #[rustc_object_lifetime_default]
4 struct A<
5     T, //~ ERROR BaseDefault
6 >(T);
7
8 #[rustc_object_lifetime_default]
9 struct B<
10     'a,
11     T, //~ ERROR BaseDefault
12 >(&'a (), T);
13
14 #[rustc_object_lifetime_default]
15 struct C<
16     'a,
17     T: 'a, //~ ERROR 'a
18 >(&'a T);
19
20 #[rustc_object_lifetime_default]
21 struct D<
22     'a,
23     'b,
24     T: 'a + 'b, //~ ERROR Ambiguous
25 >(&'a T, &'b T);
26
27 #[rustc_object_lifetime_default]
28 struct E<
29     'a,
30     'b: 'a,
31     T: 'b, //~ ERROR 'b
32 >(&'a T, &'b T);
33
34 #[rustc_object_lifetime_default]
35 struct F<
36     'a,
37     'b,
38     T: 'a, //~ ERROR 'a
39     U: 'b, //~ ERROR 'b
40 >(&'a T, &'b U);
41
42 #[rustc_object_lifetime_default]
43 struct G<
44     'a,
45     'b,
46     T: 'a,      //~ ERROR 'a
47     U: 'a + 'b, //~ ERROR Ambiguous
48 >(&'a T, &'b U);
49
50 fn main() {}