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