2020-06-27 21:36:35 +01:00
|
|
|
error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements
|
2023-01-08 02:40:59 +00:00
|
|
|
--> $DIR/issue-20831-debruijn.rs:28:33
|
2018-07-19 00:10:35 -04:00
|
|
|
|
|
2023-01-08 02:40:59 +00:00
|
|
|
LL | fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2018-07-19 00:10:35 -04:00
|
|
|
|
|
2024-02-24 02:53:05 -05:00
|
|
|
note: first, the lifetime cannot outlive the anonymous lifetime as defined here...
|
2024-08-22 02:10:45 +00:00
|
|
|
--> $DIR/issue-20831-debruijn.rs:28:67
|
2018-07-19 00:10:35 -04:00
|
|
|
|
|
2020-09-07 10:01:45 +01:00
|
|
|
LL | fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) {
|
2024-08-22 02:10:45 +00:00
|
|
|
| ^^^^^^^^^
|
2021-10-05 12:11:51 +00:00
|
|
|
note: ...but the lifetime must also be valid for the lifetime `'a` as defined here...
|
2020-01-08 20:02:10 +03:00
|
|
|
--> $DIR/issue-20831-debruijn.rs:26:6
|
|
|
|
|
|
|
|
|
LL | impl<'a> Publisher<'a> for MyStruct<'a> {
|
|
|
|
| ^^
|
|
|
|
note: ...so that the types are compatible
|
2023-01-08 02:40:59 +00:00
|
|
|
--> $DIR/issue-20831-debruijn.rs:28:33
|
2020-01-08 20:02:10 +03:00
|
|
|
|
|
2023-01-08 02:40:59 +00:00
|
|
|
LL | fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2021-10-08 01:00:15 +09:00
|
|
|
= note: expected `<MyStruct<'a> as Publisher<'_>>`
|
|
|
|
found `<MyStruct<'_> as Publisher<'_>>`
|
2020-01-08 20:02:10 +03:00
|
|
|
|
2024-02-09 12:17:55 +00:00
|
|
|
error: lifetime may not live long enough
|
|
|
|
--> $DIR/issue-20831-debruijn.rs:28:5
|
|
|
|
|
|
|
|
|
LL | impl<'a> Publisher<'a> for MyStruct<'a> {
|
|
|
|
| -- lifetime `'a` defined here
|
|
|
|
LL | type Output = u64;
|
|
|
|
LL | fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
| | |
|
|
|
|
| | has type `Box<dyn Subscriber<Input = <MyStruct<'_> as Publisher<'1>>::Output>>`
|
|
|
|
| requires that `'a` must outlive `'1`
|
|
|
|
|
|
|
|
error: lifetime may not live long enough
|
|
|
|
--> $DIR/issue-20831-debruijn.rs:28:5
|
|
|
|
|
|
|
|
|
LL | impl<'a> Publisher<'a> for MyStruct<'a> {
|
|
|
|
| -- lifetime `'a` defined here
|
|
|
|
LL | type Output = u64;
|
|
|
|
LL | fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
| | |
|
|
|
|
| | has type `Box<dyn Subscriber<Input = <MyStruct<'_> as Publisher<'1>>::Output>>`
|
|
|
|
| requires that `'1` must outlive `'a`
|
|
|
|
|
|
|
|
error: aborting due to 3 previous errors
|
2018-07-15 14:11:54 -07:00
|
|
|
|
2020-06-27 21:36:35 +01:00
|
|
|
For more information about this error, try `rustc --explain E0495`.
|