]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-20831-debruijn.stderr
Rollup merge of #75837 - GuillaumeGomez:fix-font-color-help-button, r=Cldfire
[rust.git] / src / test / ui / issues / issue-20831-debruijn.stderr
1 error[E0308]: mismatched types
2   --> $DIR/issue-20831-debruijn.rs:28:5
3    |
4 LL | /     fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) {
5 LL | |         // Not obvious, but there is an implicit lifetime here -------^
6 LL | |
7 LL | |
8 ...  |
9 LL | |         self.sub = t;
10 LL | |     }
11    | |_____^ lifetime mismatch
12    |
13    = note: expected type `'a`
14               found type `'_`
15 note: the anonymous lifetime #2 defined on the method body at 28:5...
16   --> $DIR/issue-20831-debruijn.rs:28:5
17    |
18 LL |     fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) {
19    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
20 note: ...does not necessarily outlive the lifetime `'a` as defined on the impl at 26:6
21   --> $DIR/issue-20831-debruijn.rs:26:6
22    |
23 LL | impl<'a> Publisher<'a> for MyStruct<'a> {
24    |      ^^
25
26 error[E0308]: mismatched types
27   --> $DIR/issue-20831-debruijn.rs:28:5
28    |
29 LL | /     fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) {
30 LL | |         // Not obvious, but there is an implicit lifetime here -------^
31 LL | |
32 LL | |
33 ...  |
34 LL | |         self.sub = t;
35 LL | |     }
36    | |_____^ lifetime mismatch
37    |
38    = note: expected type `'a`
39               found type `'_`
40 note: the lifetime `'a` as defined on the impl at 26:6...
41   --> $DIR/issue-20831-debruijn.rs:26:6
42    |
43 LL | impl<'a> Publisher<'a> for MyStruct<'a> {
44    |      ^^
45 note: ...does not necessarily outlive the anonymous lifetime #2 defined on the method body at 28:5
46   --> $DIR/issue-20831-debruijn.rs:28:5
47    |
48 LL |     fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) {
49    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
50
51 error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements
52   --> $DIR/issue-20831-debruijn.rs:28:33
53    |
54 LL |     fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) {
55    |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
56    |
57 note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on the method body at 28:5...
58   --> $DIR/issue-20831-debruijn.rs:28:5
59    |
60 LL |     fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) {
61    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
62 note: ...but the lifetime must also be valid for the lifetime `'a` as defined on the impl at 26:6...
63   --> $DIR/issue-20831-debruijn.rs:26:6
64    |
65 LL | impl<'a> Publisher<'a> for MyStruct<'a> {
66    |      ^^
67 note: ...so that the types are compatible
68   --> $DIR/issue-20831-debruijn.rs:28:33
69    |
70 LL |     fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) {
71    |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
72    = note: expected `Publisher<'_>`
73               found `Publisher<'_>`
74
75 error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements
76   --> $DIR/issue-20831-debruijn.rs:28:33
77    |
78 LL |     fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) {
79    |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
80    |
81 note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on the method body at 28:5...
82   --> $DIR/issue-20831-debruijn.rs:28:5
83    |
84 LL |     fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) {
85    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
86 note: ...but the lifetime must also be valid for the lifetime `'a` as defined on the impl at 26:6...
87   --> $DIR/issue-20831-debruijn.rs:26:6
88    |
89 LL | impl<'a> Publisher<'a> for MyStruct<'a> {
90    |      ^^
91 note: ...so that the types are compatible
92   --> $DIR/issue-20831-debruijn.rs:28:33
93    |
94 LL |     fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) {
95    |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
96    = note: expected `Publisher<'_>`
97               found `Publisher<'_>`
98
99 error: aborting due to 4 previous errors
100
101 Some errors have detailed explanations: E0308, E0495.
102 For more information about an error, try `rustc --explain E0308`.