1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
|
error[E0308]: mismatched types
--> $DIR/variadic-ffi-4.rs:8:5
|
LL | ap
| ^^ lifetime mismatch
|
= note: expected struct `core::ffi::VaListImpl<'f>`
found struct `core::ffi::VaListImpl<'_>`
note: the scope of call-site for function at 7:78...
--> $DIR/variadic-ffi-4.rs:7:78
|
LL | pub unsafe extern "C" fn no_escape0<'f>(_: usize, ap: ...) -> VaListImpl<'f> {
| ______________________________________________________________________________^
LL | | ap
LL | | }
| |_^
note: ...does not necessarily outlive the lifetime `'f` as defined on the function body at 7:37
--> $DIR/variadic-ffi-4.rs:7:37
|
LL | pub unsafe extern "C" fn no_escape0<'f>(_: usize, ap: ...) -> VaListImpl<'f> {
| ^^
error[E0308]: mismatched types
--> $DIR/variadic-ffi-4.rs:12:5
|
LL | ap
| ^^ lifetime mismatch
|
= note: expected struct `core::ffi::VaListImpl<'static>`
found struct `core::ffi::VaListImpl<'_>`
note: the scope of call-site for function at 11:79...
--> $DIR/variadic-ffi-4.rs:11:79
|
LL | pub unsafe extern "C" fn no_escape1(_: usize, ap: ...) -> VaListImpl<'static> {
| _______________________________________________________________________________^
LL | | ap
LL | | }
| |_^
= note: ...does not necessarily outlive the static lifetime
error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
--> $DIR/variadic-ffi-4.rs:16:33
|
LL | let _ = ap.with_copy(|ap| { ap });
| ^^
|
note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on the body at 16:26...
--> $DIR/variadic-ffi-4.rs:16:26
|
LL | let _ = ap.with_copy(|ap| { ap });
| ^^^^^^^^^^^
note: ...so that the expression is assignable
--> $DIR/variadic-ffi-4.rs:16:33
|
LL | let _ = ap.with_copy(|ap| { ap });
| ^^
= note: expected `core::ffi::VaList<'_, '_>`
found `core::ffi::VaList<'_, '_>`
note: but, the lifetime must be valid for the method call at 16:13...
--> $DIR/variadic-ffi-4.rs:16:13
|
LL | let _ = ap.with_copy(|ap| { ap });
| ^^^^^^^^^^^^^^^^^^^^^^^^^
note: ...so type `core::ffi::VaList<'_, '_>` of expression is valid during the expression
--> $DIR/variadic-ffi-4.rs:16:13
|
LL | let _ = ap.with_copy(|ap| { ap });
| ^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0308]: mismatched types
--> $DIR/variadic-ffi-4.rs:20:12
|
LL | *ap0 = ap1;
| ^^^ lifetime mismatch
|
= note: expected struct `core::ffi::VaListImpl<'_>`
found struct `core::ffi::VaListImpl<'_>`
note: the scope of call-site for function at 19:87...
--> $DIR/variadic-ffi-4.rs:19:87
|
LL | pub unsafe extern "C" fn no_escape3(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
| _______________________________________________________________________________________^
LL | | *ap0 = ap1;
LL | | }
| |_^
note: ...does not necessarily outlive the anonymous lifetime #2 defined on the function body at 19:1
--> $DIR/variadic-ffi-4.rs:19:1
|
LL | / pub unsafe extern "C" fn no_escape3(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
LL | | *ap0 = ap1;
LL | | }
| |_^
error[E0490]: a value of type `core::ffi::VaListImpl<'_>` is borrowed for too long
--> $DIR/variadic-ffi-4.rs:24:11
|
LL | ap0 = &mut ap1;
| ^^^^^^^^
|
note: the type is valid for the anonymous lifetime #1 defined on the function body at 23:1
--> $DIR/variadic-ffi-4.rs:23:1
|
LL | / pub unsafe extern "C" fn no_escape4(_: usize, ap0: &mut VaListImpl, mut ap1: ...) {
LL | | ap0 = &mut ap1;
LL | |
LL | |
LL | |
LL | | }
| |_^
note: but the borrow lasts for the scope of call-site for function at 23:83
--> $DIR/variadic-ffi-4.rs:23:83
|
LL | pub unsafe extern "C" fn no_escape4(_: usize, ap0: &mut VaListImpl, mut ap1: ...) {
| ___________________________________________________________________________________^
LL | | ap0 = &mut ap1;
LL | |
LL | |
LL | |
LL | | }
| |_^
error[E0308]: mismatched types
--> $DIR/variadic-ffi-4.rs:24:11
|
LL | ap0 = &mut ap1;
| ^^^^^^^^ lifetime mismatch
|
= note: expected mutable reference `&mut core::ffi::VaListImpl<'_>`
found mutable reference `&mut core::ffi::VaListImpl<'_>`
note: the scope of call-site for function at 23:83...
--> $DIR/variadic-ffi-4.rs:23:83
|
LL | pub unsafe extern "C" fn no_escape4(_: usize, ap0: &mut VaListImpl, mut ap1: ...) {
| ___________________________________________________________________________________^
LL | | ap0 = &mut ap1;
LL | |
LL | |
LL | |
LL | | }
| |_^
note: ...does not necessarily outlive the anonymous lifetime #2 defined on the function body at 23:1
--> $DIR/variadic-ffi-4.rs:23:1
|
LL | / pub unsafe extern "C" fn no_escape4(_: usize, ap0: &mut VaListImpl, mut ap1: ...) {
LL | | ap0 = &mut ap1;
LL | |
LL | |
LL | |
LL | | }
| |_^
error[E0495]: cannot infer an appropriate lifetime for borrow expression due to conflicting requirements
--> $DIR/variadic-ffi-4.rs:24:11
|
LL | ap0 = &mut ap1;
| ^^^^^^^^
|
note: first, the lifetime cannot outlive the scope of call-site for function at 23:83...
--> $DIR/variadic-ffi-4.rs:23:83
|
LL | pub unsafe extern "C" fn no_escape4(_: usize, ap0: &mut VaListImpl, mut ap1: ...) {
| ___________________________________________________________________________________^
LL | | ap0 = &mut ap1;
LL | |
LL | |
LL | |
LL | | }
| |_^
note: ...so that the type `core::ffi::VaListImpl<'_>` is not borrowed for too long
--> $DIR/variadic-ffi-4.rs:24:11
|
LL | ap0 = &mut ap1;
| ^^^^^^^^
note: but, the lifetime must be valid for the anonymous lifetime #1 defined on the function body at 23:1...
--> $DIR/variadic-ffi-4.rs:23:1
|
LL | / pub unsafe extern "C" fn no_escape4(_: usize, ap0: &mut VaListImpl, mut ap1: ...) {
LL | | ap0 = &mut ap1;
LL | |
LL | |
LL | |
LL | | }
| |_^
note: ...so that reference does not outlive borrowed content
--> $DIR/variadic-ffi-4.rs:24:11
|
LL | ap0 = &mut ap1;
| ^^^^^^^^
error[E0308]: mismatched types
--> $DIR/variadic-ffi-4.rs:31:12
|
LL | *ap0 = ap1.clone();
| ^^^^^^^^^^^ lifetime mismatch
|
= note: expected struct `core::ffi::VaListImpl<'_>`
found struct `core::ffi::VaListImpl<'_>`
note: the scope of call-site for function at 30:87...
--> $DIR/variadic-ffi-4.rs:30:87
|
LL | pub unsafe extern "C" fn no_escape5(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
| _______________________________________________________________________________________^
LL | | *ap0 = ap1.clone();
LL | | }
| |_^
note: ...does not necessarily outlive the anonymous lifetime #2 defined on the function body at 30:1
--> $DIR/variadic-ffi-4.rs:30:1
|
LL | / pub unsafe extern "C" fn no_escape5(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
LL | | *ap0 = ap1.clone();
LL | | }
| |_^
error: aborting due to 8 previous errors
Some errors have detailed explanations: E0308, E0495.
For more information about an error, try `rustc --explain E0308`.
|