]>
Commit | Line | Data |
---|---|---|
8faf50e0 | 1 | error[E0308]: mismatched types |
0731742a | 2 | --> $DIR/issue-20831-debruijn.rs:28:5 |
8faf50e0 | 3 | | |
dc9dc135 | 4 | LL | / fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) { |
8faf50e0 | 5 | LL | | // Not obvious, but there is an implicit lifetime here -------^ |
532ac7d7 XL |
6 | LL | | |
7 | LL | | | |
8faf50e0 XL |
8 | ... | |
9 | LL | | self.sub = t; | |
10 | LL | | } | |
11 | | |_____^ lifetime mismatch | |
12 | | | |
13 | = note: expected type `'a` | |
532ac7d7 | 14 | found type `'_` |
0731742a XL |
15 | note: the anonymous lifetime #2 defined on the method body at 28:5... |
16 | --> $DIR/issue-20831-debruijn.rs:28:5 | |
8faf50e0 | 17 | | |
dc9dc135 | 18 | LL | / fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) { |
8faf50e0 | 19 | LL | | // Not obvious, but there is an implicit lifetime here -------^ |
532ac7d7 XL |
20 | LL | | |
21 | LL | | | |
8faf50e0 XL |
22 | ... | |
23 | LL | | self.sub = t; | |
24 | LL | | } | |
25 | | |_____^ | |
e74abb32 | 26 | note: ...does not necessarily outlive the lifetime `'a` as defined on the impl at 26:6 |
0731742a | 27 | --> $DIR/issue-20831-debruijn.rs:26:6 |
8faf50e0 XL |
28 | | |
29 | LL | impl<'a> Publisher<'a> for MyStruct<'a> { | |
30 | | ^^ | |
31 | ||
32 | error[E0308]: mismatched types | |
0731742a | 33 | --> $DIR/issue-20831-debruijn.rs:28:5 |
8faf50e0 | 34 | | |
dc9dc135 | 35 | LL | / fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) { |
8faf50e0 | 36 | LL | | // Not obvious, but there is an implicit lifetime here -------^ |
532ac7d7 XL |
37 | LL | | |
38 | LL | | | |
8faf50e0 XL |
39 | ... | |
40 | LL | | self.sub = t; | |
41 | LL | | } | |
42 | | |_____^ lifetime mismatch | |
43 | | | |
44 | = note: expected type `'a` | |
532ac7d7 | 45 | found type `'_` |
e74abb32 | 46 | note: the lifetime `'a` as defined on the impl at 26:6... |
0731742a | 47 | --> $DIR/issue-20831-debruijn.rs:26:6 |
8faf50e0 XL |
48 | | |
49 | LL | impl<'a> Publisher<'a> for MyStruct<'a> { | |
50 | | ^^ | |
0731742a XL |
51 | note: ...does not necessarily outlive the anonymous lifetime #2 defined on the method body at 28:5 |
52 | --> $DIR/issue-20831-debruijn.rs:28:5 | |
8faf50e0 | 53 | | |
dc9dc135 | 54 | LL | / fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) { |
8faf50e0 | 55 | LL | | // Not obvious, but there is an implicit lifetime here -------^ |
532ac7d7 XL |
56 | LL | | |
57 | LL | | | |
8faf50e0 XL |
58 | ... | |
59 | LL | | self.sub = t; | |
60 | LL | | } | |
61 | | |_____^ | |
62 | ||
63 | error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements | |
74b04a01 | 64 | --> $DIR/issue-20831-debruijn.rs:28:33 |
8faf50e0 | 65 | | |
74b04a01 XL |
66 | LL | fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) { |
67 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
8faf50e0 | 68 | | |
0731742a XL |
69 | note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on the method body at 28:5... |
70 | --> $DIR/issue-20831-debruijn.rs:28:5 | |
8faf50e0 | 71 | | |
dc9dc135 | 72 | LL | / fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) { |
8faf50e0 | 73 | LL | | // Not obvious, but there is an implicit lifetime here -------^ |
532ac7d7 XL |
74 | LL | | |
75 | LL | | | |
8faf50e0 XL |
76 | ... | |
77 | LL | | self.sub = t; | |
78 | LL | | } | |
79 | | |_____^ | |
e74abb32 | 80 | note: ...but the lifetime must also be valid for the lifetime `'a` as defined on the impl at 26:6... |
0731742a | 81 | --> $DIR/issue-20831-debruijn.rs:26:6 |
8faf50e0 XL |
82 | | |
83 | LL | impl<'a> Publisher<'a> for MyStruct<'a> { | |
84 | | ^^ | |
60c5eb7d | 85 | note: ...so that the types are compatible |
74b04a01 | 86 | --> $DIR/issue-20831-debruijn.rs:28:33 |
60c5eb7d | 87 | | |
74b04a01 XL |
88 | LL | fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) { |
89 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
f9f354fc XL |
90 | = note: expected `Publisher<'_>` |
91 | found `Publisher<'_>` | |
8faf50e0 | 92 | |
dfeec247 | 93 | error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements |
74b04a01 | 94 | --> $DIR/issue-20831-debruijn.rs:28:33 |
dfeec247 | 95 | | |
74b04a01 XL |
96 | LL | fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) { |
97 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
dfeec247 XL |
98 | | |
99 | note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on the method body at 28:5... | |
100 | --> $DIR/issue-20831-debruijn.rs:28:5 | |
101 | | | |
102 | LL | / fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) { | |
103 | LL | | // Not obvious, but there is an implicit lifetime here -------^ | |
104 | LL | | | |
105 | LL | | | |
106 | ... | | |
107 | LL | | self.sub = t; | |
108 | LL | | } | |
109 | | |_____^ | |
110 | note: ...but the lifetime must also be valid for the lifetime `'a` as defined on the impl at 26:6... | |
111 | --> $DIR/issue-20831-debruijn.rs:26:6 | |
112 | | | |
113 | LL | impl<'a> Publisher<'a> for MyStruct<'a> { | |
114 | | ^^ | |
115 | note: ...so that the types are compatible | |
74b04a01 | 116 | --> $DIR/issue-20831-debruijn.rs:28:33 |
dfeec247 | 117 | | |
74b04a01 XL |
118 | LL | fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) { |
119 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
f9f354fc XL |
120 | = note: expected `Publisher<'_>` |
121 | found `Publisher<'_>` | |
dfeec247 XL |
122 | |
123 | error: aborting due to 4 previous errors | |
8faf50e0 | 124 | |
e74abb32 XL |
125 | Some errors have detailed explanations: E0308, E0495. |
126 | For more information about an error, try `rustc --explain E0308`. |