@@ -52,24 +52,51 @@ note: the anonymous lifetime #3 defined on the function body at 19:1...
5252 |
5353LL | / pub unsafe extern "C" fn no_escape3(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
5454LL | | *ap0 = ap1;
55+ LL | |
5556LL | | }
5657 | |_^
5758note: ...does not necessarily outlive the anonymous lifetime #2 defined on the function body at 19:1
5859 --> $DIR/variadic-ffi-4.rs:19:1
5960 |
6061LL | / pub unsafe extern "C" fn no_escape3(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
6162LL | | *ap0 = ap1;
63+ LL | |
64+ LL | | }
65+ | |_^
66+
67+ error[E0308]: mismatched types
68+ --> $DIR/variadic-ffi-4.rs:20:12
69+ |
70+ LL | *ap0 = ap1;
71+ | ^^^ lifetime mismatch
72+ |
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
77+ |
78+ LL | / pub unsafe extern "C" fn no_escape3(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
79+ LL | | *ap0 = ap1;
80+ LL | |
81+ LL | | }
82+ | |_^
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
85+ |
86+ LL | / pub unsafe extern "C" fn no_escape3(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
87+ LL | | *ap0 = ap1;
88+ LL | |
6289LL | | }
6390 | |_^
6491
6592error[E0490]: a value of type `core::ffi::VaListImpl<'_>` is borrowed for too long
66- --> $DIR/variadic-ffi-4.rs:24 :11
93+ --> $DIR/variadic-ffi-4.rs:25 :11
6794 |
6895LL | ap0 = &mut ap1;
6996 | ^^^^^^^^
7097 |
71- note: the type is valid for the anonymous lifetime #1 defined on the function body at 23 :1
72- --> $DIR/variadic-ffi-4.rs:23 :1
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
73100 |
74101LL | / pub unsafe extern "C" fn no_escape4(_: usize, ap0: &mut VaListImpl, mut ap1: ...) {
75102LL | | ap0 = &mut ap1;
@@ -79,8 +106,8 @@ LL | |
79106LL | |
80107LL | | }
81108 | |_^
82- note: but the borrow lasts for the anonymous lifetime #3 defined on the function body at 23 :1
83- --> $DIR/variadic-ffi-4.rs:23 :1
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
84111 |
85112LL | / pub unsafe extern "C" fn no_escape4(_: usize, ap0: &mut VaListImpl, mut ap1: ...) {
86113LL | | ap0 = &mut ap1;
@@ -92,15 +119,15 @@ LL | | }
92119 | |_^
93120
94121error[E0308]: mismatched types
95- --> $DIR/variadic-ffi-4.rs:24 :11
122+ --> $DIR/variadic-ffi-4.rs:25 :11
96123 |
97124LL | ap0 = &mut ap1;
98125 | ^^^^^^^^ lifetime mismatch
99126 |
100127 = note: expected type `&mut core::ffi::VaListImpl<'_>`
101128 found type `&mut core::ffi::VaListImpl<'_>`
102- note: the anonymous lifetime #3 defined on the function body at 23 :1...
103- --> $DIR/variadic-ffi-4.rs:23 :1
129+ note: the anonymous lifetime #3 defined on the function body at 24 :1...
130+ --> $DIR/variadic-ffi-4.rs:24 :1
104131 |
105132LL | / pub unsafe extern "C" fn no_escape4(_: usize, ap0: &mut VaListImpl, mut ap1: ...) {
106133LL | | ap0 = &mut ap1;
@@ -110,8 +137,8 @@ LL | |
110137LL | |
111138LL | | }
112139 | |_^
113- note: ...does not necessarily outlive the anonymous lifetime #2 defined on the function body at 23 :1
114- --> $DIR/variadic-ffi-4.rs:23 :1
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
115142 |
116143LL | / pub unsafe extern "C" fn no_escape4(_: usize, ap0: &mut VaListImpl, mut ap1: ...) {
117144LL | | ap0 = &mut ap1;
@@ -123,15 +150,15 @@ LL | | }
123150 | |_^
124151
125152error[E0308]: mismatched types
126- --> $DIR/variadic-ffi-4.rs:24 :11
153+ --> $DIR/variadic-ffi-4.rs:25 :11
127154 |
128155LL | ap0 = &mut ap1;
129156 | ^^^^^^^^ lifetime mismatch
130157 |
131158 = note: expected type `&mut core::ffi::VaListImpl<'_>`
132159 found type `&mut core::ffi::VaListImpl<'_>`
133- note: the anonymous lifetime #2 defined on the function body at 23 :1...
134- --> $DIR/variadic-ffi-4.rs:23 :1
160+ note: the anonymous lifetime #2 defined on the function body at 24 :1...
161+ --> $DIR/variadic-ffi-4.rs:24 :1
135162 |
136163LL | / pub unsafe extern "C" fn no_escape4(_: usize, ap0: &mut VaListImpl, mut ap1: ...) {
137164LL | | ap0 = &mut ap1;
@@ -141,8 +168,8 @@ LL | |
141168LL | |
142169LL | | }
143170 | |_^
144- note: ...does not necessarily outlive the anonymous lifetime #3 defined on the function body at 23 :1
145- --> $DIR/variadic-ffi-4.rs:23 :1
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
146173 |
147174LL | / pub unsafe extern "C" fn no_escape4(_: usize, ap0: &mut VaListImpl, mut ap1: ...) {
148175LL | | ap0 = &mut ap1;
@@ -154,13 +181,13 @@ LL | | }
154181 | |_^
155182
156183error[E0495]: cannot infer an appropriate lifetime for borrow expression due to conflicting requirements
157- --> $DIR/variadic-ffi-4.rs:24 :11
184+ --> $DIR/variadic-ffi-4.rs:25 :11
158185 |
159186LL | ap0 = &mut ap1;
160187 | ^^^^^^^^
161188 |
162- note: first, the lifetime cannot outlive the anonymous lifetime #3 defined on the function body at 23 :1...
163- --> $DIR/variadic-ffi-4.rs:23 :1
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
164191 |
165192LL | / pub unsafe extern "C" fn no_escape4(_: usize, ap0: &mut VaListImpl, mut ap1: ...) {
166193LL | | ap0 = &mut ap1;
@@ -171,12 +198,12 @@ LL | |
171198LL | | }
172199 | |_^
173200note: ...so that the type `core::ffi::VaListImpl<'_>` is not borrowed for too long
174- --> $DIR/variadic-ffi-4.rs:24 :11
201+ --> $DIR/variadic-ffi-4.rs:25 :11
175202 |
176203LL | ap0 = &mut ap1;
177204 | ^^^^^^^^
178- note: but, the lifetime must be valid for the anonymous lifetime #1 defined on the function body at 23 :1...
179- --> $DIR/variadic-ffi-4.rs:23 :1
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
180207 |
181208LL | / pub unsafe extern "C" fn no_escape4(_: usize, ap0: &mut VaListImpl, mut ap1: ...) {
182209LL | | ap0 = &mut ap1;
@@ -187,39 +214,62 @@ LL | |
187214LL | | }
188215 | |_^
189216note: ...so that reference does not outlive borrowed content
190- --> $DIR/variadic-ffi-4.rs:24 :11
217+ --> $DIR/variadic-ffi-4.rs:25 :11
191218 |
192219LL | ap0 = &mut ap1;
193220 | ^^^^^^^^
194221
195- error[E0495 ]: cannot infer an appropriate lifetime due to conflicting requirements
196- --> $DIR/variadic-ffi-4.rs:32:16
222+ error[E0308 ]: mismatched types
223+ --> $DIR/variadic-ffi-4.rs:33:12
197224 |
198225LL | *ap0 = ap1.clone();
199- | ^^^^^
226+ | ^^^^^^^^^^^ lifetime mismatch
200227 |
201- note: first, the lifetime cannot outlive the anonymous lifetime #3 defined on the function body at 31:1...
202- --> $DIR/variadic-ffi-4.rs:31:1
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
203232 |
204233LL | / pub unsafe extern "C" fn no_escape5(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
205234LL | | *ap0 = ap1.clone();
235+ LL | |
206236LL | | }
207237 | |_^
208- = note: ...so that the types are compatible:
209- expected &core::ffi::VaListImpl<'_>
210- found &core::ffi::VaListImpl<'_>
211- note: but, the lifetime must be valid for the anonymous lifetime #2 defined on the function body at 31:1...
212- --> $DIR/variadic-ffi-4.rs:31:1
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
213240 |
214241LL | / pub unsafe extern "C" fn no_escape5(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
215242LL | | *ap0 = ap1.clone();
243+ LL | |
244+ LL | | }
245+ | |_^
246+
247+ error[E0308]: mismatched types
248+ --> $DIR/variadic-ffi-4.rs:33:12
249+ |
250+ LL | *ap0 = ap1.clone();
251+ | ^^^^^^^^^^^ lifetime mismatch
252+ |
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
257+ |
258+ LL | / pub unsafe extern "C" fn no_escape5(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
259+ LL | | *ap0 = ap1.clone();
260+ LL | |
261+ LL | | }
262+ | |_^
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
265+ |
266+ LL | / pub unsafe extern "C" fn no_escape5(_: usize, mut ap0: &mut VaListImpl, mut ap1: ...) {
267+ LL | | *ap0 = ap1.clone();
268+ LL | |
216269LL | | }
217270 | |_^
218- = note: ...so that the expression is assignable:
219- expected core::ffi::VaListImpl<'_>
220- found core::ffi::VaListImpl<'_>
221271
222- error: aborting due to 9 previous errors
272+ error: aborting due to 11 previous errors
223273
224274Some errors have detailed explanations: E0308, E0621.
225275For more information about an error, try `rustc --explain E0308`.
0 commit comments