]> git.proxmox.com Git - rustc.git/blob - src/test/ui/issues/issue-20831-debruijn.stderr
New upstream version 1.41.1+dfsg1
[rustc.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 LL | | // Not obvious, but there is an implicit lifetime here -------^
20 LL | |
21 LL | |
22 ... |
23 LL | | self.sub = t;
24 LL | | }
25 | |_____^
26 note: ...does not necessarily outlive the lifetime `'a` as defined on the impl at 26:6
27 --> $DIR/issue-20831-debruijn.rs:26:6
28 |
29 LL | impl<'a> Publisher<'a> for MyStruct<'a> {
30 | ^^
31
32 error[E0308]: mismatched types
33 --> $DIR/issue-20831-debruijn.rs:28:5
34 |
35 LL | / fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) {
36 LL | | // Not obvious, but there is an implicit lifetime here -------^
37 LL | |
38 LL | |
39 ... |
40 LL | | self.sub = t;
41 LL | | }
42 | |_____^ lifetime mismatch
43 |
44 = note: expected type `'a`
45 found type `'_`
46 note: the lifetime `'a` as defined on the impl at 26:6...
47 --> $DIR/issue-20831-debruijn.rs:26:6
48 |
49 LL | impl<'a> Publisher<'a> for MyStruct<'a> {
50 | ^^
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
53 |
54 LL | / fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) {
55 LL | | // Not obvious, but there is an implicit lifetime here -------^
56 LL | |
57 LL | |
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
64 --> $DIR/issue-20831-debruijn.rs:28:5
65 |
66 LL | / fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) {
67 LL | | // Not obvious, but there is an implicit lifetime here -------^
68 LL | |
69 LL | |
70 ... |
71 LL | | self.sub = t;
72 LL | | }
73 | |_____^
74 |
75 note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on the method body at 28:5...
76 --> $DIR/issue-20831-debruijn.rs:28:5
77 |
78 LL | / fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) {
79 LL | | // Not obvious, but there is an implicit lifetime here -------^
80 LL | |
81 LL | |
82 ... |
83 LL | | self.sub = t;
84 LL | | }
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:5
93 |
94 LL | / fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) {
95 LL | | // Not obvious, but there is an implicit lifetime here -------^
96 LL | |
97 LL | |
98 ... |
99 LL | | self.sub = t;
100 LL | | }
101 | |_____^
102 = note: expected `Publisher<'_>`
103 found `Publisher<'_>`
104
105 error: aborting due to 3 previous errors
106
107 Some errors have detailed explanations: E0308, E0495.
108 For more information about an error, try `rustc --explain E0308`.