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

error: incompatible lifetime on type
  --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:27:18
   |
LL |     type T<'a> = Box<dyn A + 'a>;
   |                  ^^^^^^^^^^^^^^^
   |
note: because this has an unmet lifetime requirement
  --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:23:17
   |
LL |     type T<'a>: C;
   |                 ^ introduces a `'static` lifetime requirement
note: the lifetime `'a` as defined here...
  --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:27:12
   |
LL |     type T<'a> = Box<dyn A + 'a>;
   |            ^^
note: ...does not necessarily outlive the static lifetime introduced by the compatible `impl`
  --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:21:1
   |
LL | impl C for Box<dyn A + 'static> {}
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: incompatible lifetime on type
  --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:37:18
   |
LL |     type T<'a> = (Box<dyn A + 'a>, Box<dyn A + 'a>);
   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: because this has an unmet lifetime requirement
  --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:33:17
   |
LL |     type T<'a>: E;
   |                 ^ introduces a `'static` lifetime requirement
note: the lifetime `'a` as defined here...
  --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:37:12
   |
LL |     type T<'a> = (Box<dyn A + 'a>, Box<dyn A + 'a>);
   |            ^^
   = note: ...does not necessarily outlive the static lifetime introduced by the compatible `impl`
note: this has an implicit `'static` lifetime requirement
  --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:31:21
   |
LL | impl E for (Box<dyn A>, Box<dyn A>) {}
   |                     ^
note: this has an implicit `'static` lifetime requirement
  --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:31:33
   |
LL | impl E for (Box<dyn A>, Box<dyn A>) {}
   |                                 ^
help: consider relaxing the implicit `'static` requirement
   |
LL | impl E for (Box<dyn A + '_>, Box<dyn A>) {}
   |                       ++++
help: consider relaxing the implicit `'static` requirement
   |
LL | impl E for (Box<dyn A>, Box<dyn A + '_>) {}
   |                                   ++++

error: aborting due to 3 previous errors