1 error[E0308]: mismatched types
2 --> $DIR/issue-20831-debruijn.rs:28:5
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 -------^
11 | |_____^ lifetime mismatch
13 = note: expected type `'a`
15 note: the anonymous lifetime #2 defined on the method body at 28:5...
16 --> $DIR/issue-20831-debruijn.rs:28:5
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
23 LL | impl<'a> Publisher<'a> for MyStruct<'a> {
26 error[E0308]: mismatched types
27 --> $DIR/issue-20831-debruijn.rs:28:5
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 -------^
36 | |_____^ lifetime mismatch
38 = note: expected type `'a`
40 note: the lifetime `'a` as defined on the impl at 26:6...
41 --> $DIR/issue-20831-debruijn.rs:26:6
43 LL | impl<'a> Publisher<'a> for MyStruct<'a> {
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
48 LL | fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) {
49 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
51 error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements
52 --> $DIR/issue-20831-debruijn.rs:28:33
54 LL | fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) {
55 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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
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
65 LL | impl<'a> Publisher<'a> for MyStruct<'a> {
67 note: ...so that the types are compatible
68 --> $DIR/issue-20831-debruijn.rs:28:33
70 LL | fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) {
71 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
72 = note: expected `Publisher<'_>`
75 error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements
76 --> $DIR/issue-20831-debruijn.rs:28:33
78 LL | fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) {
79 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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
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
89 LL | impl<'a> Publisher<'a> for MyStruct<'a> {
91 note: ...so that the types are compatible
92 --> $DIR/issue-20831-debruijn.rs:28:33
94 LL | fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) {
95 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
96 = note: expected `Publisher<'_>`
99 error: aborting due to 4 previous errors
101 Some errors have detailed explanations: E0308, E0495.
102 For more information about an error, try `rustc --explain E0308`.