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