fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #67350 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum73528e339aa

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