]> git.proxmox.com Git - rustc.git/blob - src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.stderr
New upstream version 1.63.0+dfsg1
[rustc.git] / src / test / ui / suggestions / lifetimes / missing-lifetimes-in-signature.stderr
1 error[E0261]: use of undeclared lifetime name `'a`
2 --> $DIR/missing-lifetimes-in-signature.rs:37:11
3 |
4 LL | fn baz<G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
5 | - ^^ undeclared lifetime
6 | |
7 | help: consider introducing lifetime `'a` here: `'a,`
8
9 error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
10 --> $DIR/missing-lifetimes-in-signature.rs:19:5
11 |
12 LL | fn foo<G, T>(g: G, dest: &mut T) -> impl FnOnce()
13 | ------ hidden type `[closure@$DIR/missing-lifetimes-in-signature.rs:19:5: 22:6]` captures the anonymous lifetime defined here
14 ...
15 LL | / move || {
16 LL | |
17 LL | | *dest = g.get();
18 LL | | }
19 | |_____^
20 |
21 help: to declare that the `impl Trait` captures `'_`, you can add an explicit `'_` lifetime bound
22 |
23 LL | fn foo<G, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
24 | ++++
25
26 error[E0311]: the parameter type `G` may not live long enough
27 --> $DIR/missing-lifetimes-in-signature.rs:30:5
28 |
29 LL | / move || {
30 LL | |
31 LL | | *dest = g.get();
32 LL | | }
33 | |_____^
34 |
35 note: the parameter type `G` must be valid for the anonymous lifetime defined here...
36 --> $DIR/missing-lifetimes-in-signature.rs:26:26
37 |
38 LL | fn bar<G, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
39 | ^^^^^^
40 note: ...so that the type `G` will meet its required lifetime bounds
41 --> $DIR/missing-lifetimes-in-signature.rs:30:5
42 |
43 LL | / move || {
44 LL | |
45 LL | | *dest = g.get();
46 LL | | }
47 | |_____^
48 help: consider adding an explicit lifetime bound...
49 |
50 LL | G: Get<T> + 'a,
51 | ++++
52
53 error[E0311]: the parameter type `G` may not live long enough
54 --> $DIR/missing-lifetimes-in-signature.rs:52:5
55 |
56 LL | / move || {
57 LL | |
58 LL | | *dest = g.get();
59 LL | | }
60 | |_____^
61 |
62 note: the parameter type `G` must be valid for the anonymous lifetime defined here...
63 --> $DIR/missing-lifetimes-in-signature.rs:48:34
64 |
65 LL | fn qux<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
66 | ^^^^^^
67 note: ...so that the type `G` will meet its required lifetime bounds
68 --> $DIR/missing-lifetimes-in-signature.rs:52:5
69 |
70 LL | / move || {
71 LL | |
72 LL | | *dest = g.get();
73 LL | | }
74 | |_____^
75 help: consider adding an explicit lifetime bound...
76 |
77 LL | fn qux<'a, G: 'a + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
78 | ++++
79
80 error[E0311]: the parameter type `G` may not live long enough
81 --> $DIR/missing-lifetimes-in-signature.rs:61:9
82 |
83 LL | / move || {
84 LL | |
85 LL | | *dest = g.get();
86 LL | | }
87 | |_________^
88 |
89 note: the parameter type `G` must be valid for the anonymous lifetime defined here...
90 --> $DIR/missing-lifetimes-in-signature.rs:60:47
91 |
92 LL | fn qux<'b, G: Get<T> + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ {
93 | ^^^^^^
94 note: ...so that the type `G` will meet its required lifetime bounds
95 --> $DIR/missing-lifetimes-in-signature.rs:61:9
96 |
97 LL | / move || {
98 LL | |
99 LL | | *dest = g.get();
100 LL | | }
101 | |_________^
102 help: consider adding an explicit lifetime bound...
103 |
104 LL | fn qux<'b, G: Get<T> + 'b + 'c, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ {
105 | ++++
106
107 error[E0311]: the parameter type `G` may not live long enough
108 --> $DIR/missing-lifetimes-in-signature.rs:73:5
109 |
110 LL | / move || {
111 LL | |
112 LL | |
113 LL | | *dest = g.get();
114 LL | | }
115 | |_____^
116 |
117 note: the parameter type `G` must be valid for the anonymous lifetime defined here...
118 --> $DIR/missing-lifetimes-in-signature.rs:69:34
119 |
120 LL | fn bat<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a
121 | ^^^^^^
122 note: ...so that the type `G` will meet its required lifetime bounds
123 --> $DIR/missing-lifetimes-in-signature.rs:73:5
124 |
125 LL | / move || {
126 LL | |
127 LL | |
128 LL | | *dest = g.get();
129 LL | | }
130 | |_____^
131 help: consider adding an explicit lifetime bound...
132 |
133 LL | fn bat<'a, G: 'a + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a
134 | ++++
135
136 error[E0621]: explicit lifetime required in the type of `dest`
137 --> $DIR/missing-lifetimes-in-signature.rs:73:5
138 |
139 LL | fn bat<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a
140 | ------ help: add explicit lifetime `'a` to the type of `dest`: `&'a mut T`
141 ...
142 LL | / move || {
143 LL | |
144 LL | |
145 LL | | *dest = g.get();
146 LL | | }
147 | |_____^ lifetime `'a` required
148
149 error[E0309]: the parameter type `G` may not live long enough
150 --> $DIR/missing-lifetimes-in-signature.rs:85:5
151 |
152 LL | / move || {
153 LL | |
154 LL | | *dest = g.get();
155 LL | | }
156 | |_____^ ...so that the type `G` will meet its required lifetime bounds
157 |
158 help: consider adding an explicit lifetime bound...
159 |
160 LL | G: Get<T> + 'a,
161 | ++++
162
163 error: aborting due to 8 previous errors
164
165 Some errors have detailed explanations: E0261, E0309, E0621, E0700.
166 For more information about an error, try `rustc --explain E0261`.