os-rust/tests/ui/issues/issue-20831-debruijn.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

52 lines
2.5 KiB
Text
Raw Normal View History

error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements
--> $DIR/issue-20831-debruijn.rs:28:33
|
LL | fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: first, the lifetime cannot outlive the anonymous lifetime defined here...
2021-02-22 23:39:06 +09:00
--> $DIR/issue-20831-debruijn.rs:28:58
|
2020-09-07 10:01:45 +01:00
LL | fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) {
2021-02-22 23:39:06 +09: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
--> $DIR/issue-20831-debruijn.rs:28:33
2020-01-08 20:02:10 +03:00
|
LL | fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: expected `<MyStruct<'a> as Publisher<'_>>`
found `<MyStruct<'_> as Publisher<'_>>`
2020-01-08 20:02:10 +03: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
For more information about this error, try `rustc --explain E0495`.