1 error: lifetime may not live long enough
2 --> $DIR/variadic-ffi-4.rs:8:5
4 LL | pub unsafe extern "C" fn no_escape0<'f>(_: usize, ap: ...) -> VaListImpl<'f> {
5 | -- -- has type `core::ffi::VaListImpl<'1>`
7 | lifetime `'f` defined here
9 | ^^ function was supposed to return data with lifetime `'1` but it is returning data with lifetime `'f`
11 error: lifetime may not live long enough
12 --> $DIR/variadic-ffi-4.rs:8:5
14 LL | pub unsafe extern "C" fn no_escape0<'f>(_: usize, ap: ...) -> VaListImpl<'f> {
15 | -- -- has type `core::ffi::VaListImpl<'1>`
17 | lifetime `'f` defined here
19 | ^^ returning this value requires that `'1` must outlive `'f`
21 error: lifetime may not live long enough
22 --> $DIR/variadic-ffi-4.rs:12:5
24 LL | pub unsafe extern "C" fn no_escape1(_: usize, ap: ...) -> VaListImpl<'static> {
25 | -- has type `core::ffi::VaListImpl<'1>`
27 | ^^ returning this value requires that `'1` must outlive `'static`
29 error: lifetime may not live long enough
30 --> $DIR/variadic-ffi-4.rs:16:33
32 LL | let _ = ap.with_copy(|ap| { ap });
33 | --- ^^ returning this value requires that `'1` must outlive `'2`
35 | | return type of closure is core::ffi::VaList<'2, '_>
36 | has type `core::ffi::VaList<'1, '_>`
38 error: lifetime may not live long enough
39 --> $DIR/variadic-ffi-4.rs:20:5
41 LL | pub unsafe extern "C" fn no_escape3(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
42 | ------- ------- has type `core::ffi::VaListImpl<'2>`
44 | has type `&mut core::ffi::VaListImpl<'1>`
46 | ^^^^ assignment requires that `'1` must outlive `'2`
48 error: lifetime may not live long enough
49 --> $DIR/variadic-ffi-4.rs:20:5
51 LL | pub unsafe extern "C" fn no_escape3(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
52 | ------- ------- has type `core::ffi::VaListImpl<'2>`
54 | has type `&mut core::ffi::VaListImpl<'1>`
56 | ^^^^ assignment requires that `'2` must outlive `'1`
58 error: lifetime may not live long enough
59 --> $DIR/variadic-ffi-4.rs:24:5
61 LL | pub unsafe extern "C" fn no_escape4(_: usize, ap0: &mut VaListImpl, mut ap1: ...) {
62 | --- ------- has type `core::ffi::VaListImpl<'2>`
64 | has type `&mut core::ffi::VaListImpl<'1>`
66 | ^^^^^^^^^^^^^^ assignment requires that `'1` must outlive `'2`
68 error: lifetime may not live long enough
69 --> $DIR/variadic-ffi-4.rs:24:5
71 LL | pub unsafe extern "C" fn no_escape4(_: usize, ap0: &mut VaListImpl, mut ap1: ...) {
72 | --- ------- has type `core::ffi::VaListImpl<'2>`
74 | has type `&mut core::ffi::VaListImpl<'1>`
76 | ^^^^^^^^^^^^^^ assignment requires that `'2` must outlive `'1`
78 error[E0384]: cannot assign to immutable argument `ap0`
79 --> $DIR/variadic-ffi-4.rs:24:5
81 LL | pub unsafe extern "C" fn no_escape4(_: usize, ap0: &mut VaListImpl, mut ap1: ...) {
82 | --- help: make this binding mutable: `mut ap0`
84 | ^^^^^^^^^^^^^^ cannot assign to immutable argument
86 error[E0597]: `ap1` does not live long enough
87 --> $DIR/variadic-ffi-4.rs:24:11
89 LL | pub unsafe extern "C" fn no_escape4(_: usize, ap0: &mut VaListImpl, mut ap1: ...) {
90 | - let's call the lifetime of this reference `'3`
94 | | borrowed value does not live long enough
95 | assignment requires that `ap1` is borrowed for `'3`
98 | - `ap1` dropped here while still borrowed
100 error: lifetime may not live long enough
101 --> $DIR/variadic-ffi-4.rs:31:12
103 LL | pub unsafe extern "C" fn no_escape5(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
104 | ------- ------- has type `core::ffi::VaListImpl<'2>`
106 | has type `&mut core::ffi::VaListImpl<'1>`
107 LL | *ap0 = ap1.clone();
108 | ^^^^^^^^^^^ argument requires that `'1` must outlive `'2`
110 error: lifetime may not live long enough
111 --> $DIR/variadic-ffi-4.rs:31:12
113 LL | pub unsafe extern "C" fn no_escape5(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
114 | ------- ------- has type `core::ffi::VaListImpl<'2>`
116 | has type `&mut core::ffi::VaListImpl<'1>`
117 LL | *ap0 = ap1.clone();
118 | ^^^^^^^^^^^ argument requires that `'2` must outlive `'1`
120 error: aborting due to 12 previous errors
122 Some errors have detailed explanations: E0384, E0597.
123 For more information about an error, try `rustc --explain E0384`.