]> git.lizzy.rs Git - rust.git/blob - tests/ui/generic-associated-types/issue-78113-lifetime-mismatch-dyn-trait-box.stderr
Rollup merge of #103702 - WaffleLapkin:lift-sized-bounds-from-pointer-methods-where...
[rust.git] / tests / ui / generic-associated-types / issue-78113-lifetime-mismatch-dyn-trait-box.stderr
1 error: incompatible lifetime on type
2   --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:15:18
3    |
4 LL |     type T<'a> = Box<dyn A + 'a>;
5    |                  ^^^^^^^^^^^^^^^
6    |
7 note: because this has an unmet lifetime requirement
8   --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:10:17
9    |
10 LL |     type T<'a>: A;
11    |                 ^ introduces a `'static` lifetime requirement
12 note: the lifetime `'a` as defined here...
13   --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:15:12
14    |
15 LL |     type T<'a> = Box<dyn A + 'a>;
16    |            ^^
17    = note: ...does not necessarily outlive the static lifetime introduced by the compatible `impl`
18 note: this has an implicit `'static` lifetime requirement
19   --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:7:20
20    |
21 LL | impl A for Box<dyn A> {}
22    |                    ^
23 help: consider relaxing the implicit `'static` requirement
24    |
25 LL | impl A for Box<dyn A + '_> {}
26    |                      ++++
27
28 error: incompatible lifetime on type
29   --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:25:18
30    |
31 LL |     type T<'a> = Box<dyn A + 'a>;
32    |                  ^^^^^^^^^^^^^^^
33    |
34 note: because this has an unmet lifetime requirement
35   --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:21:17
36    |
37 LL |     type T<'a>: C;
38    |                 ^ introduces a `'static` lifetime requirement
39 note: the lifetime `'a` as defined here...
40   --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:25:12
41    |
42 LL |     type T<'a> = Box<dyn A + 'a>;
43    |            ^^
44 note: ...does not necessarily outlive the static lifetime introduced by the compatible `impl`
45   --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:19:1
46    |
47 LL | impl C for Box<dyn A + 'static> {}
48    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
49
50 error: incompatible lifetime on type
51   --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:35:18
52    |
53 LL |     type T<'a> = (Box<dyn A + 'a>, Box<dyn A + 'a>);
54    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
55    |
56 note: because this has an unmet lifetime requirement
57   --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:31:17
58    |
59 LL |     type T<'a>: E;
60    |                 ^ introduces a `'static` lifetime requirement
61 note: the lifetime `'a` as defined here...
62   --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:35:12
63    |
64 LL |     type T<'a> = (Box<dyn A + 'a>, Box<dyn A + 'a>);
65    |            ^^
66    = note: ...does not necessarily outlive the static lifetime introduced by the compatible `impl`
67 note: this has an implicit `'static` lifetime requirement
68   --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:29:21
69    |
70 LL | impl E for (Box<dyn A>, Box<dyn A>) {}
71    |                     ^
72 note: this has an implicit `'static` lifetime requirement
73   --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:29:33
74    |
75 LL | impl E for (Box<dyn A>, Box<dyn A>) {}
76    |                                 ^
77 help: consider relaxing the implicit `'static` requirement
78    |
79 LL | impl E for (Box<dyn A + '_>, Box<dyn A>) {}
80    |                       ++++
81 help: consider relaxing the implicit `'static` requirement
82    |
83 LL | impl E for (Box<dyn A>, Box<dyn A + '_>) {}
84    |                                   ++++
85
86 error: aborting due to 3 previous errors
87