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 `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 = note: requirement occurs because of the type `VaListImpl<'_>`, which makes the generic argument `'_` invariant
12 = note: the struct `VaListImpl<'f>` is invariant over the parameter `'f`
13 = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
15 error: lifetime may not live long enough
16 --> $DIR/variadic-ffi-4.rs:8:5
18 LL | pub unsafe extern "C" fn no_escape0<'f>(_: usize, ap: ...) -> VaListImpl<'f> {
19 | -- -- has type `VaListImpl<'1>`
21 | lifetime `'f` defined here
23 | ^^ function was supposed to return data with lifetime `'f` but it is returning data with lifetime `'1`
25 = note: requirement occurs because of the type `VaListImpl<'_>`, which makes the generic argument `'_` invariant
26 = note: the struct `VaListImpl<'f>` is invariant over the parameter `'f`
27 = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
29 error: lifetime may not live long enough
30 --> $DIR/variadic-ffi-4.rs:14:5
32 LL | pub unsafe extern "C" fn no_escape1(_: usize, ap: ...) -> VaListImpl<'static> {
33 | -- has type `VaListImpl<'1>`
35 | ^^ returning this value requires that `'1` must outlive `'static`
37 = note: requirement occurs because of the type `VaListImpl<'_>`, which makes the generic argument `'_` invariant
38 = note: the struct `VaListImpl<'f>` is invariant over the parameter `'f`
39 = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
41 error: lifetime may not live long enough
42 --> $DIR/variadic-ffi-4.rs:18:31
44 LL | let _ = ap.with_copy(|ap| ap);
45 | --- ^^ returning this value requires that `'1` must outlive `'2`
47 | | return type of closure is VaList<'2, '_>
48 | has type `VaList<'1, '_>`
50 error: lifetime may not live long enough
51 --> $DIR/variadic-ffi-4.rs:22:5
53 LL | pub unsafe extern "C" fn no_escape3(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
54 | ------- ------- has type `VaListImpl<'2>`
56 | has type `&mut VaListImpl<'1>`
58 | ^^^^ assignment requires that `'1` must outlive `'2`
60 = note: requirement occurs because of the type `VaListImpl<'_>`, which makes the generic argument `'_` invariant
61 = note: the struct `VaListImpl<'f>` is invariant over the parameter `'f`
62 = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
64 error: lifetime may not live long enough
65 --> $DIR/variadic-ffi-4.rs:22:5
67 LL | pub unsafe extern "C" fn no_escape3(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
68 | ------- ------- has type `VaListImpl<'2>`
70 | has type `&mut VaListImpl<'1>`
72 | ^^^^ assignment requires that `'2` must outlive `'1`
74 = note: requirement occurs because of the type `VaListImpl<'_>`, which makes the generic argument `'_` invariant
75 = note: the struct `VaListImpl<'f>` is invariant over the parameter `'f`
76 = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
78 error: lifetime may not live long enough
79 --> $DIR/variadic-ffi-4.rs:28:5
81 LL | pub unsafe extern "C" fn no_escape4(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
82 | ------- ------- has type `VaListImpl<'2>`
84 | has type `&mut VaListImpl<'1>`
86 | ^^^^^^^^^^^^^^ assignment requires that `'1` must outlive `'2`
88 = note: requirement occurs because of a mutable reference to `VaListImpl<'_>`
89 = note: mutable references are invariant over their type parameter
90 = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
92 error: lifetime may not live long enough
93 --> $DIR/variadic-ffi-4.rs:28:5
95 LL | pub unsafe extern "C" fn no_escape4(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
96 | ------- ------- has type `VaListImpl<'2>`
98 | has type `&mut VaListImpl<'1>`
100 | ^^^^^^^^^^^^^^ assignment requires that `'2` must outlive `'1`
102 = note: requirement occurs because of a mutable reference to `VaListImpl<'_>`
103 = note: mutable references are invariant over their type parameter
104 = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
106 error[E0597]: `ap1` does not live long enough
107 --> $DIR/variadic-ffi-4.rs:28:11
109 LL | pub unsafe extern "C" fn no_escape4(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
110 | - let's call the lifetime of this reference `'3`
114 | | borrowed value does not live long enough
115 | assignment requires that `ap1` is borrowed for `'3`
118 | - `ap1` dropped here while still borrowed
120 error: lifetime may not live long enough
121 --> $DIR/variadic-ffi-4.rs:35:12
123 LL | pub unsafe extern "C" fn no_escape5(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
124 | ------- ------- has type `VaListImpl<'2>`
126 | has type `&mut VaListImpl<'1>`
127 LL | *ap0 = ap1.clone();
128 | ^^^^^^^^^^^ argument requires that `'1` must outlive `'2`
130 = note: requirement occurs because of the type `VaListImpl<'_>`, which makes the generic argument `'_` invariant
131 = note: the struct `VaListImpl<'f>` is invariant over the parameter `'f`
132 = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
134 error: lifetime may not live long enough
135 --> $DIR/variadic-ffi-4.rs:35:12
137 LL | pub unsafe extern "C" fn no_escape5(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
138 | ------- ------- has type `VaListImpl<'2>`
140 | has type `&mut VaListImpl<'1>`
141 LL | *ap0 = ap1.clone();
142 | ^^^^^^^^^^^ argument requires that `'2` must outlive `'1`
144 = note: requirement occurs because of the type `VaListImpl<'_>`, which makes the generic argument `'_` invariant
145 = note: the struct `VaListImpl<'f>` is invariant over the parameter `'f`
146 = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
148 error: aborting due to 11 previous errors
150 For more information about this error, try `rustc --explain E0597`.