1 error[E0621]: explicit lifetime required in the type of `ap`
2 --> $DIR/variadic-ffi-4.rs:8:5
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>`
7 | ^^ lifetime `'f` required
9 error[E0621]: explicit lifetime required in the type of `ap`
10 --> $DIR/variadic-ffi-4.rs:12:5
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>`
15 | ^^ lifetime `'static` required
17 error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
18 --> $DIR/variadic-ffi-4.rs:16:33
20 LL | let _ = ap.with_copy(|ap| { ap });
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
26 LL | let _ = ap.with_copy(|ap| { ap });
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
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
39 LL | let _ = ap.with_copy(|ap| { ap });
40 | ^^^^^^^^^^^^^^^^^^^^^^^^^
42 error[E0308]: mismatched types
43 --> $DIR/variadic-ffi-4.rs:20:12
46 | ^^^ lifetime mismatch
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
53 LL | / pub unsafe extern "C" fn no_escape3(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
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
61 LL | / pub unsafe extern "C" fn no_escape3(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
67 error[E0308]: mismatched types
68 --> $DIR/variadic-ffi-4.rs:20:12
71 | ^^^ lifetime mismatch
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
78 LL | / pub unsafe extern "C" fn no_escape3(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
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
86 LL | / pub unsafe extern "C" fn no_escape3(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
92 error[E0490]: a value of type `core::ffi::VaListImpl<'_>` is borrowed for too long
93 --> $DIR/variadic-ffi-4.rs:25:11
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
101 LL | / pub unsafe extern "C" fn no_escape4(_: usize, ap0: &mut VaListImpl, mut ap1: ...) {
102 LL | | ap0 = &mut ap1;
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
112 LL | / pub unsafe extern "C" fn no_escape4(_: usize, ap0: &mut VaListImpl, mut ap1: ...) {
113 LL | | ap0 = &mut ap1;
121 error[E0308]: mismatched types
122 --> $DIR/variadic-ffi-4.rs:25:11
125 | ^^^^^^^^ lifetime mismatch
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
132 LL | / pub unsafe extern "C" fn no_escape4(_: usize, ap0: &mut VaListImpl, mut ap1: ...) {
133 LL | | ap0 = &mut ap1;
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
143 LL | / pub unsafe extern "C" fn no_escape4(_: usize, ap0: &mut VaListImpl, mut ap1: ...) {
144 LL | | ap0 = &mut ap1;
152 error[E0308]: mismatched types
153 --> $DIR/variadic-ffi-4.rs:25:11
156 | ^^^^^^^^ lifetime mismatch
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
163 LL | / pub unsafe extern "C" fn no_escape4(_: usize, ap0: &mut VaListImpl, mut ap1: ...) {
164 LL | | ap0 = &mut ap1;
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
174 LL | / pub unsafe extern "C" fn no_escape4(_: usize, ap0: &mut VaListImpl, mut ap1: ...) {
175 LL | | ap0 = &mut ap1;
183 error[E0495]: cannot infer an appropriate lifetime for borrow expression due to conflicting requirements
184 --> $DIR/variadic-ffi-4.rs:25:11
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
192 LL | / pub unsafe extern "C" fn no_escape4(_: usize, ap0: &mut VaListImpl, mut ap1: ...) {
193 LL | | ap0 = &mut ap1;
200 note: ...so that the type `core::ffi::VaListImpl<'_>` is not borrowed for too long
201 --> $DIR/variadic-ffi-4.rs:25:11
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
208 LL | / pub unsafe extern "C" fn no_escape4(_: usize, ap0: &mut VaListImpl, mut ap1: ...) {
209 LL | | ap0 = &mut ap1;
216 note: ...so that reference does not outlive borrowed content
217 --> $DIR/variadic-ffi-4.rs:25:11
222 error[E0308]: mismatched types
223 --> $DIR/variadic-ffi-4.rs:33:12
225 LL | *ap0 = ap1.clone();
226 | ^^^^^^^^^^^ lifetime mismatch
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
233 LL | / pub unsafe extern "C" fn no_escape5(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
234 LL | | *ap0 = ap1.clone();
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
241 LL | / pub unsafe extern "C" fn no_escape5(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
242 LL | | *ap0 = ap1.clone();
247 error[E0308]: mismatched types
248 --> $DIR/variadic-ffi-4.rs:33:12
250 LL | *ap0 = ap1.clone();
251 | ^^^^^^^^^^^ lifetime mismatch
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
258 LL | / pub unsafe extern "C" fn no_escape5(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
259 LL | | *ap0 = ap1.clone();
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
266 LL | / pub unsafe extern "C" fn no_escape5(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
267 LL | | *ap0 = ap1.clone();
272 error: aborting due to 11 previous errors
274 Some errors have detailed explanations: E0308, E0621.
275 For more information about an error, try `rustc --explain E0308`.