]> git.proxmox.com Git - rustc.git/blob - src/test/ui/c-variadic/variadic-ffi-4.stderr
New upstream version 1.38.0+dfsg1
[rustc.git] / src / test / ui / c-variadic / variadic-ffi-4.stderr
1 error[E0621]: explicit lifetime required in the type of `ap`
2 --> $DIR/variadic-ffi-4.rs:8:5
3 |
4 LL | pub unsafe extern "C" fn no_escape0<'f>(_: usize, ap: ...) -> VaListImpl<'f> {
5 | --- help: add explicit lifetime `'f` to the type of `ap`: `core::ffi::VaListImpl<'f>`
6 LL | ap
7 | ^^ lifetime `'f` required
8
9 error[E0621]: explicit lifetime required in the type of `ap`
10 --> $DIR/variadic-ffi-4.rs:12:5
11 |
12 LL | pub unsafe extern "C" fn no_escape1(_: usize, ap: ...) -> VaListImpl<'static> {
13 | --- help: add explicit lifetime `'static` to the type of `ap`: `core::ffi::VaListImpl<'static>`
14 LL | ap
15 | ^^ lifetime `'static` required
16
17 error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
18 --> $DIR/variadic-ffi-4.rs:16:33
19 |
20 LL | let _ = ap.with_copy(|ap| { ap });
21 | ^^
22 |
23 note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on the body at 16:26...
24 --> $DIR/variadic-ffi-4.rs:16:26
25 |
26 LL | let _ = ap.with_copy(|ap| { ap });
27 | ^^^^^^^^^^^
28 = note: ...so that the expression is assignable:
29 expected core::ffi::VaList<'_, '_>
30 found core::ffi::VaList<'_, '_>
31 note: but, the lifetime must be valid for the method call at 16:13...
32 --> $DIR/variadic-ffi-4.rs:16:13
33 |
34 LL | let _ = ap.with_copy(|ap| { ap });
35 | ^^^^^^^^^^^^^^^^^^^^^^^^^
36 note: ...so type `core::ffi::VaList<'_, '_>` of expression is valid during the expression
37 --> $DIR/variadic-ffi-4.rs:16:13
38 |
39 LL | let _ = ap.with_copy(|ap| { ap });
40 | ^^^^^^^^^^^^^^^^^^^^^^^^^
41
42 error[E0308]: mismatched types
43 --> $DIR/variadic-ffi-4.rs:20:12
44 |
45 LL | *ap0 = ap1;
46 | ^^^ lifetime mismatch
47 |
48 = note: expected type `core::ffi::VaListImpl<'_>`
49 found type `core::ffi::VaListImpl<'_>`
50 note: the anonymous lifetime #3 defined on the function body at 19:1...
51 --> $DIR/variadic-ffi-4.rs:19:1
52 |
53 LL | / pub unsafe extern "C" fn no_escape3(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
54 LL | | *ap0 = ap1;
55 LL | |
56 LL | | }
57 | |_^
58 note: ...does not necessarily outlive the anonymous lifetime #2 defined on the function body at 19:1
59 --> $DIR/variadic-ffi-4.rs:19:1
60 |
61 LL | / pub unsafe extern "C" fn no_escape3(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
62 LL | | *ap0 = ap1;
63 LL | |
64 LL | | }
65 | |_^
66
67 error[E0308]: mismatched types
68 --> $DIR/variadic-ffi-4.rs:20:12
69 |
70 LL | *ap0 = ap1;
71 | ^^^ lifetime mismatch
72 |
73 = note: expected type `core::ffi::VaListImpl<'_>`
74 found type `core::ffi::VaListImpl<'_>`
75 note: the anonymous lifetime #2 defined on the function body at 19:1...
76 --> $DIR/variadic-ffi-4.rs:19:1
77 |
78 LL | / pub unsafe extern "C" fn no_escape3(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
79 LL | | *ap0 = ap1;
80 LL | |
81 LL | | }
82 | |_^
83 note: ...does not necessarily outlive the anonymous lifetime #3 defined on the function body at 19:1
84 --> $DIR/variadic-ffi-4.rs:19:1
85 |
86 LL | / pub unsafe extern "C" fn no_escape3(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
87 LL | | *ap0 = ap1;
88 LL | |
89 LL | | }
90 | |_^
91
92 error[E0490]: a value of type `core::ffi::VaListImpl<'_>` is borrowed for too long
93 --> $DIR/variadic-ffi-4.rs:25:11
94 |
95 LL | ap0 = &mut ap1;
96 | ^^^^^^^^
97 |
98 note: the type is valid for the anonymous lifetime #1 defined on the function body at 24:1
99 --> $DIR/variadic-ffi-4.rs:24:1
100 |
101 LL | / pub unsafe extern "C" fn no_escape4(_: usize, ap0: &mut VaListImpl, mut ap1: ...) {
102 LL | | ap0 = &mut ap1;
103 LL | |
104 LL | |
105 LL | |
106 LL | |
107 LL | | }
108 | |_^
109 note: but the borrow lasts for the anonymous lifetime #3 defined on the function body at 24:1
110 --> $DIR/variadic-ffi-4.rs:24:1
111 |
112 LL | / pub unsafe extern "C" fn no_escape4(_: usize, ap0: &mut VaListImpl, mut ap1: ...) {
113 LL | | ap0 = &mut ap1;
114 LL | |
115 LL | |
116 LL | |
117 LL | |
118 LL | | }
119 | |_^
120
121 error[E0308]: mismatched types
122 --> $DIR/variadic-ffi-4.rs:25:11
123 |
124 LL | ap0 = &mut ap1;
125 | ^^^^^^^^ lifetime mismatch
126 |
127 = note: expected type `&mut core::ffi::VaListImpl<'_>`
128 found type `&mut core::ffi::VaListImpl<'_>`
129 note: the anonymous lifetime #3 defined on the function body at 24:1...
130 --> $DIR/variadic-ffi-4.rs:24:1
131 |
132 LL | / pub unsafe extern "C" fn no_escape4(_: usize, ap0: &mut VaListImpl, mut ap1: ...) {
133 LL | | ap0 = &mut ap1;
134 LL | |
135 LL | |
136 LL | |
137 LL | |
138 LL | | }
139 | |_^
140 note: ...does not necessarily outlive the anonymous lifetime #2 defined on the function body at 24:1
141 --> $DIR/variadic-ffi-4.rs:24:1
142 |
143 LL | / pub unsafe extern "C" fn no_escape4(_: usize, ap0: &mut VaListImpl, mut ap1: ...) {
144 LL | | ap0 = &mut ap1;
145 LL | |
146 LL | |
147 LL | |
148 LL | |
149 LL | | }
150 | |_^
151
152 error[E0308]: mismatched types
153 --> $DIR/variadic-ffi-4.rs:25:11
154 |
155 LL | ap0 = &mut ap1;
156 | ^^^^^^^^ lifetime mismatch
157 |
158 = note: expected type `&mut core::ffi::VaListImpl<'_>`
159 found type `&mut core::ffi::VaListImpl<'_>`
160 note: the anonymous lifetime #2 defined on the function body at 24:1...
161 --> $DIR/variadic-ffi-4.rs:24:1
162 |
163 LL | / pub unsafe extern "C" fn no_escape4(_: usize, ap0: &mut VaListImpl, mut ap1: ...) {
164 LL | | ap0 = &mut ap1;
165 LL | |
166 LL | |
167 LL | |
168 LL | |
169 LL | | }
170 | |_^
171 note: ...does not necessarily outlive the anonymous lifetime #3 defined on the function body at 24:1
172 --> $DIR/variadic-ffi-4.rs:24:1
173 |
174 LL | / pub unsafe extern "C" fn no_escape4(_: usize, ap0: &mut VaListImpl, mut ap1: ...) {
175 LL | | ap0 = &mut ap1;
176 LL | |
177 LL | |
178 LL | |
179 LL | |
180 LL | | }
181 | |_^
182
183 error[E0495]: cannot infer an appropriate lifetime for borrow expression due to conflicting requirements
184 --> $DIR/variadic-ffi-4.rs:25:11
185 |
186 LL | ap0 = &mut ap1;
187 | ^^^^^^^^
188 |
189 note: first, the lifetime cannot outlive the anonymous lifetime #3 defined on the function body at 24:1...
190 --> $DIR/variadic-ffi-4.rs:24:1
191 |
192 LL | / pub unsafe extern "C" fn no_escape4(_: usize, ap0: &mut VaListImpl, mut ap1: ...) {
193 LL | | ap0 = &mut ap1;
194 LL | |
195 LL | |
196 LL | |
197 LL | |
198 LL | | }
199 | |_^
200 note: ...so that the type `core::ffi::VaListImpl<'_>` is not borrowed for too long
201 --> $DIR/variadic-ffi-4.rs:25:11
202 |
203 LL | ap0 = &mut ap1;
204 | ^^^^^^^^
205 note: but, the lifetime must be valid for the anonymous lifetime #1 defined on the function body at 24:1...
206 --> $DIR/variadic-ffi-4.rs:24:1
207 |
208 LL | / pub unsafe extern "C" fn no_escape4(_: usize, ap0: &mut VaListImpl, mut ap1: ...) {
209 LL | | ap0 = &mut ap1;
210 LL | |
211 LL | |
212 LL | |
213 LL | |
214 LL | | }
215 | |_^
216 note: ...so that reference does not outlive borrowed content
217 --> $DIR/variadic-ffi-4.rs:25:11
218 |
219 LL | ap0 = &mut ap1;
220 | ^^^^^^^^
221
222 error[E0308]: mismatched types
223 --> $DIR/variadic-ffi-4.rs:33:12
224 |
225 LL | *ap0 = ap1.clone();
226 | ^^^^^^^^^^^ lifetime mismatch
227 |
228 = note: expected type `core::ffi::VaListImpl<'_>`
229 found type `core::ffi::VaListImpl<'_>`
230 note: the anonymous lifetime #3 defined on the function body at 32:1...
231 --> $DIR/variadic-ffi-4.rs:32:1
232 |
233 LL | / pub unsafe extern "C" fn no_escape5(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
234 LL | | *ap0 = ap1.clone();
235 LL | |
236 LL | | }
237 | |_^
238 note: ...does not necessarily outlive the anonymous lifetime #2 defined on the function body at 32:1
239 --> $DIR/variadic-ffi-4.rs:32:1
240 |
241 LL | / pub unsafe extern "C" fn no_escape5(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
242 LL | | *ap0 = ap1.clone();
243 LL | |
244 LL | | }
245 | |_^
246
247 error[E0308]: mismatched types
248 --> $DIR/variadic-ffi-4.rs:33:12
249 |
250 LL | *ap0 = ap1.clone();
251 | ^^^^^^^^^^^ lifetime mismatch
252 |
253 = note: expected type `core::ffi::VaListImpl<'_>`
254 found type `core::ffi::VaListImpl<'_>`
255 note: the anonymous lifetime #2 defined on the function body at 32:1...
256 --> $DIR/variadic-ffi-4.rs:32:1
257 |
258 LL | / pub unsafe extern "C" fn no_escape5(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
259 LL | | *ap0 = ap1.clone();
260 LL | |
261 LL | | }
262 | |_^
263 note: ...does not necessarily outlive the anonymous lifetime #3 defined on the function body at 32:1
264 --> $DIR/variadic-ffi-4.rs:32:1
265 |
266 LL | / pub unsafe extern "C" fn no_escape5(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
267 LL | | *ap0 = ap1.clone();
268 LL | |
269 LL | | }
270 | |_^
271
272 error: aborting due to 11 previous errors
273
274 Some errors have detailed explanations: E0308, E0621.
275 For more information about an error, try `rustc --explain E0308`.