1 error[E0308]: mismatched types
2 --> $DIR/variadic-ffi-4.rs:8:5
7 = note: expected struct `core::ffi::VaListImpl<'f>`
8 found struct `core::ffi::VaListImpl<'_>`
9 note: the scope of call-site for function at 7:78...
10 --> $DIR/variadic-ffi-4.rs:7:78
12 LL | pub unsafe extern "C" fn no_escape0<'f>(_: usize, ap: ...) -> VaListImpl<'f> {
13 | ______________________________________________________________________________^
17 note: ...does not necessarily outlive the lifetime `'f` as defined on the function body at 7:37
18 --> $DIR/variadic-ffi-4.rs:7:37
20 LL | pub unsafe extern "C" fn no_escape0<'f>(_: usize, ap: ...) -> VaListImpl<'f> {
23 error[E0308]: mismatched types
24 --> $DIR/variadic-ffi-4.rs:12:5
27 | ^^ lifetime mismatch
29 = note: expected struct `core::ffi::VaListImpl<'static>`
30 found struct `core::ffi::VaListImpl<'_>`
31 note: the scope of call-site for function at 11:79...
32 --> $DIR/variadic-ffi-4.rs:11:79
34 LL | pub unsafe extern "C" fn no_escape1(_: usize, ap: ...) -> VaListImpl<'static> {
35 | _______________________________________________________________________________^
39 = note: ...does not necessarily outlive the static lifetime
41 error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
42 --> $DIR/variadic-ffi-4.rs:16:33
44 LL | let _ = ap.with_copy(|ap| { ap });
47 note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on the body at 16:26...
48 --> $DIR/variadic-ffi-4.rs:16:26
50 LL | let _ = ap.with_copy(|ap| { ap });
52 note: ...so that the expression is assignable
53 --> $DIR/variadic-ffi-4.rs:16:33
55 LL | let _ = ap.with_copy(|ap| { ap });
57 = note: expected `core::ffi::VaList<'_, '_>`
58 found `core::ffi::VaList<'_, '_>`
59 note: but, the lifetime must be valid for the method call at 16:13...
60 --> $DIR/variadic-ffi-4.rs:16:13
62 LL | let _ = ap.with_copy(|ap| { ap });
63 | ^^^^^^^^^^^^^^^^^^^^^^^^^
64 note: ...so type `core::ffi::VaList<'_, '_>` of expression is valid during the expression
65 --> $DIR/variadic-ffi-4.rs:16:13
67 LL | let _ = ap.with_copy(|ap| { ap });
68 | ^^^^^^^^^^^^^^^^^^^^^^^^^
70 error[E0308]: mismatched types
71 --> $DIR/variadic-ffi-4.rs:20:12
74 | ^^^ lifetime mismatch
76 = note: expected struct `core::ffi::VaListImpl<'_>`
77 found struct `core::ffi::VaListImpl<'_>`
78 note: the scope of call-site for function at 19:87...
79 --> $DIR/variadic-ffi-4.rs:19:87
81 LL | pub unsafe extern "C" fn no_escape3(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
82 | _______________________________________________________________________________________^
86 note: ...does not necessarily outlive the anonymous lifetime #2 defined on the function body at 19:1
87 --> $DIR/variadic-ffi-4.rs:19:1
89 LL | / pub unsafe extern "C" fn no_escape3(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
94 error[E0490]: a value of type `core::ffi::VaListImpl<'_>` is borrowed for too long
95 --> $DIR/variadic-ffi-4.rs:24:11
100 note: the type is valid for the anonymous lifetime #1 defined on the function body at 23:1
101 --> $DIR/variadic-ffi-4.rs:23:1
103 LL | / pub unsafe extern "C" fn no_escape4(_: usize, ap0: &mut VaListImpl, mut ap1: ...) {
104 LL | | ap0 = &mut ap1;
110 note: but the borrow lasts for the scope of call-site for function at 23:83
111 --> $DIR/variadic-ffi-4.rs:23:83
113 LL | pub unsafe extern "C" fn no_escape4(_: usize, ap0: &mut VaListImpl, mut ap1: ...) {
114 | ___________________________________________________________________________________^
115 LL | | ap0 = &mut ap1;
122 error[E0308]: mismatched types
123 --> $DIR/variadic-ffi-4.rs:24:11
126 | ^^^^^^^^ lifetime mismatch
128 = note: expected mutable reference `&mut core::ffi::VaListImpl<'_>`
129 found mutable reference `&mut core::ffi::VaListImpl<'_>`
130 note: the scope of call-site for function at 23:83...
131 --> $DIR/variadic-ffi-4.rs:23:83
133 LL | pub unsafe extern "C" fn no_escape4(_: usize, ap0: &mut VaListImpl, mut ap1: ...) {
134 | ___________________________________________________________________________________^
135 LL | | ap0 = &mut ap1;
141 note: ...does not necessarily outlive the anonymous lifetime #2 defined on the function body at 23:1
142 --> $DIR/variadic-ffi-4.rs:23:1
144 LL | / pub unsafe extern "C" fn no_escape4(_: usize, ap0: &mut VaListImpl, mut ap1: ...) {
145 LL | | ap0 = &mut ap1;
152 error[E0495]: cannot infer an appropriate lifetime for borrow expression due to conflicting requirements
153 --> $DIR/variadic-ffi-4.rs:24:11
158 note: first, the lifetime cannot outlive the scope of call-site for function at 23:83...
159 --> $DIR/variadic-ffi-4.rs:23:83
161 LL | pub unsafe extern "C" fn no_escape4(_: usize, ap0: &mut VaListImpl, mut ap1: ...) {
162 | ___________________________________________________________________________________^
163 LL | | ap0 = &mut ap1;
169 note: ...so that the type `core::ffi::VaListImpl<'_>` is not borrowed for too long
170 --> $DIR/variadic-ffi-4.rs:24:11
174 note: but, the lifetime must be valid for the anonymous lifetime #1 defined on the function body at 23:1...
175 --> $DIR/variadic-ffi-4.rs:23:1
177 LL | / pub unsafe extern "C" fn no_escape4(_: usize, ap0: &mut VaListImpl, mut ap1: ...) {
178 LL | | ap0 = &mut ap1;
184 note: ...so that reference does not outlive borrowed content
185 --> $DIR/variadic-ffi-4.rs:24:11
190 error[E0308]: mismatched types
191 --> $DIR/variadic-ffi-4.rs:31:12
193 LL | *ap0 = ap1.clone();
194 | ^^^^^^^^^^^ lifetime mismatch
196 = note: expected struct `core::ffi::VaListImpl<'_>`
197 found struct `core::ffi::VaListImpl<'_>`
198 note: the scope of call-site for function at 30:87...
199 --> $DIR/variadic-ffi-4.rs:30:87
201 LL | pub unsafe extern "C" fn no_escape5(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
202 | _______________________________________________________________________________________^
203 LL | | *ap0 = ap1.clone();
206 note: ...does not necessarily outlive the anonymous lifetime #2 defined on the function body at 30:1
207 --> $DIR/variadic-ffi-4.rs:30:1
209 LL | / pub unsafe extern "C" fn no_escape5(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
210 LL | | *ap0 = ap1.clone();
214 error: aborting due to 8 previous errors
216 Some errors have detailed explanations: E0308, E0495.
217 For more information about an error, try `rustc --explain E0308`.