@@ -3,16 +3,30 @@ error: `...` is not supported for non-extern functions
33 |
44LL | fn f1_1(x: isize, ...) {}
55 | ^^^
6+ |
7+ = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
68
79error: `...` is not supported for non-extern functions
810 --> $DIR/variadic-ffi-semantic-restrictions.rs:9:9
911 |
1012LL | fn f1_2(...) {}
1113 | ^^^
14+ |
15+ = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
1216
13- error: functions with a C variable argument list must be unsafe
17+ error: `...` is not supported for `extern "Rust"` functions
1418 --> $DIR/variadic-ffi-semantic-restrictions.rs:12:30
1519 |
20+ LL | unsafe extern "Rust" fn f1_3(...) {}
21+ | ------------- ^^^
22+ | |
23+ | `extern "Rust"` because of this
24+ |
25+ = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
26+
27+ error: functions with a C variable argument list must be unsafe
28+ --> $DIR/variadic-ffi-semantic-restrictions.rs:15:30
29+ |
1630LL | extern "C" fn f2_1(x: isize, ...) {}
1731 | ^^^
1832 |
@@ -22,7 +36,7 @@ LL | unsafe extern "C" fn f2_1(x: isize, ...) {}
2236 | ++++++
2337
2438error: functions with a C variable argument list must be unsafe
25- --> $DIR/variadic-ffi-semantic-restrictions.rs:15 :20
39+ --> $DIR/variadic-ffi-semantic-restrictions.rs:18 :20
2640 |
2741LL | extern "C" fn f2_2(...) {}
2842 | ^^^
@@ -33,13 +47,13 @@ LL | unsafe extern "C" fn f2_2(...) {}
3347 | ++++++
3448
3549error: `...` must be the last argument of a C-variadic function
36- --> $DIR/variadic-ffi-semantic-restrictions.rs:18 :20
50+ --> $DIR/variadic-ffi-semantic-restrictions.rs:21 :20
3751 |
3852LL | extern "C" fn f2_3(..., x: isize) {}
3953 | ^^^
4054
4155error: functions with a C variable argument list must be unsafe
42- --> $DIR/variadic-ffi-semantic-restrictions.rs:21 :30
56+ --> $DIR/variadic-ffi-semantic-restrictions.rs:24 :30
4357 |
4458LL | extern "C" fn f3_1(x: isize, ...) {}
4559 | ^^^
@@ -50,7 +64,7 @@ LL | unsafe extern "C" fn f3_1(x: isize, ...) {}
5064 | ++++++
5165
5266error: functions with a C variable argument list must be unsafe
53- --> $DIR/variadic-ffi-semantic-restrictions.rs:24 :20
67+ --> $DIR/variadic-ffi-semantic-restrictions.rs:27 :20
5468 |
5569LL | extern "C" fn f3_2(...) {}
5670 | ^^^
@@ -61,25 +75,25 @@ LL | unsafe extern "C" fn f3_2(...) {}
6175 | ++++++
6276
6377error: `...` must be the last argument of a C-variadic function
64- --> $DIR/variadic-ffi-semantic-restrictions.rs:27 :20
78+ --> $DIR/variadic-ffi-semantic-restrictions.rs:30 :20
6579 |
6680LL | extern "C" fn f3_3(..., x: isize) {}
6781 | ^^^
6882
6983error: functions cannot be both `const` and C-variadic
70- --> $DIR/variadic-ffi-semantic-restrictions.rs:30 :1
84+ --> $DIR/variadic-ffi-semantic-restrictions.rs:33 :1
7185 |
7286LL | const unsafe extern "C" fn f4_1(x: isize, ...) {}
7387 | ^^^^^ `const` because of this ^^^ C-variadic because of this
7488
7589error: functions cannot be both `const` and C-variadic
76- --> $DIR/variadic-ffi-semantic-restrictions.rs:34 :1
90+ --> $DIR/variadic-ffi-semantic-restrictions.rs:37 :1
7791 |
7892LL | const extern "C" fn f4_2(x: isize, ...) {}
7993 | ^^^^^ `const` because of this ^^^ C-variadic because of this
8094
8195error: functions with a C variable argument list must be unsafe
82- --> $DIR/variadic-ffi-semantic-restrictions.rs:34 :36
96+ --> $DIR/variadic-ffi-semantic-restrictions.rs:37 :36
8397 |
8498LL | const extern "C" fn f4_2(x: isize, ...) {}
8599 | ^^^
@@ -90,19 +104,19 @@ LL | const unsafe extern "C" fn f4_2(x: isize, ...) {}
90104 | ++++++
91105
92106error: `...` must be the last argument of a C-variadic function
93- --> $DIR/variadic-ffi-semantic-restrictions.rs:39 :26
107+ --> $DIR/variadic-ffi-semantic-restrictions.rs:42 :26
94108 |
95109LL | const extern "C" fn f4_3(..., x: isize, ...) {}
96110 | ^^^
97111
98112error: functions cannot be both `const` and C-variadic
99- --> $DIR/variadic-ffi-semantic-restrictions.rs:39 :1
113+ --> $DIR/variadic-ffi-semantic-restrictions.rs:42 :1
100114 |
101115LL | const extern "C" fn f4_3(..., x: isize, ...) {}
102116 | ^^^^^ `const` because of this ^^^ C-variadic because of this
103117
104118error: functions with a C variable argument list must be unsafe
105- --> $DIR/variadic-ffi-semantic-restrictions.rs:39 :41
119+ --> $DIR/variadic-ffi-semantic-restrictions.rs:42 :41
106120 |
107121LL | const extern "C" fn f4_3(..., x: isize, ...) {}
108122 | ^^^
@@ -113,121 +127,121 @@ LL | const unsafe extern "C" fn f4_3(..., x: isize, ...) {}
113127 | ++++++
114128
115129error: `...` must be the last argument of a C-variadic function
116- --> $DIR/variadic-ffi-semantic-restrictions.rs:45 :13
130+ --> $DIR/variadic-ffi-semantic-restrictions.rs:48 :13
117131 |
118132LL | fn e_f2(..., x: isize);
119133 | ^^^
120134
121135error: associated functions cannot have a C variable argument list
122- --> $DIR/variadic-ffi-semantic-restrictions.rs:52 :23
136+ --> $DIR/variadic-ffi-semantic-restrictions.rs:55 :23
123137 |
124138LL | fn i_f1(x: isize, ...) {}
125139 | ^^^
126140
127141error: associated functions cannot have a C variable argument list
128- --> $DIR/variadic-ffi-semantic-restrictions.rs:54 :13
142+ --> $DIR/variadic-ffi-semantic-restrictions.rs:57 :13
129143 |
130144LL | fn i_f2(...) {}
131145 | ^^^
132146
133147error: `...` must be the last argument of a C-variadic function
134- --> $DIR/variadic-ffi-semantic-restrictions.rs:56 :13
148+ --> $DIR/variadic-ffi-semantic-restrictions.rs:59 :13
135149 |
136150LL | fn i_f3(..., x: isize, ...) {}
137151 | ^^^
138152
139153error: associated functions cannot have a C variable argument list
140- --> $DIR/variadic-ffi-semantic-restrictions.rs:56 :28
154+ --> $DIR/variadic-ffi-semantic-restrictions.rs:59 :28
141155 |
142156LL | fn i_f3(..., x: isize, ...) {}
143157 | ^^^
144158
145159error: `...` must be the last argument of a C-variadic function
146- --> $DIR/variadic-ffi-semantic-restrictions.rs:59 :13
160+ --> $DIR/variadic-ffi-semantic-restrictions.rs:62 :13
147161 |
148162LL | fn i_f4(..., x: isize, ...) {}
149163 | ^^^
150164
151165error: associated functions cannot have a C variable argument list
152- --> $DIR/variadic-ffi-semantic-restrictions.rs:59 :28
166+ --> $DIR/variadic-ffi-semantic-restrictions.rs:62 :28
153167 |
154168LL | fn i_f4(..., x: isize, ...) {}
155169 | ^^^
156170
157171error: functions cannot be both `const` and C-variadic
158- --> $DIR/variadic-ffi-semantic-restrictions.rs:62 :5
172+ --> $DIR/variadic-ffi-semantic-restrictions.rs:65 :5
159173 |
160174LL | const fn i_f5(x: isize, ...) {}
161175 | ^^^^^ ^^^ C-variadic because of this
162176 | |
163177 | `const` because of this
164178
165179error: associated functions cannot have a C variable argument list
166- --> $DIR/variadic-ffi-semantic-restrictions.rs:62 :29
180+ --> $DIR/variadic-ffi-semantic-restrictions.rs:65 :29
167181 |
168182LL | const fn i_f5(x: isize, ...) {}
169183 | ^^^
170184
171185error: associated functions cannot have a C variable argument list
172- --> $DIR/variadic-ffi-semantic-restrictions.rs:69 :23
186+ --> $DIR/variadic-ffi-semantic-restrictions.rs:72 :23
173187 |
174188LL | fn t_f1(x: isize, ...) {}
175189 | ^^^
176190
177191error: associated functions cannot have a C variable argument list
178- --> $DIR/variadic-ffi-semantic-restrictions.rs:71 :23
192+ --> $DIR/variadic-ffi-semantic-restrictions.rs:74 :23
179193 |
180194LL | fn t_f2(x: isize, ...);
181195 | ^^^
182196
183197error: associated functions cannot have a C variable argument list
184- --> $DIR/variadic-ffi-semantic-restrictions.rs:73 :13
198+ --> $DIR/variadic-ffi-semantic-restrictions.rs:76 :13
185199 |
186200LL | fn t_f3(...) {}
187201 | ^^^
188202
189203error: associated functions cannot have a C variable argument list
190- --> $DIR/variadic-ffi-semantic-restrictions.rs:75 :13
204+ --> $DIR/variadic-ffi-semantic-restrictions.rs:78 :13
191205 |
192206LL | fn t_f4(...);
193207 | ^^^
194208
195209error: `...` must be the last argument of a C-variadic function
196- --> $DIR/variadic-ffi-semantic-restrictions.rs:77 :13
210+ --> $DIR/variadic-ffi-semantic-restrictions.rs:80 :13
197211 |
198212LL | fn t_f5(..., x: isize) {}
199213 | ^^^
200214
201215error: `...` must be the last argument of a C-variadic function
202- --> $DIR/variadic-ffi-semantic-restrictions.rs:79 :13
216+ --> $DIR/variadic-ffi-semantic-restrictions.rs:82 :13
203217 |
204218LL | fn t_f6(..., x: isize);
205219 | ^^^
206220
207221error[E0493]: destructor of `VaListImpl<'_>` cannot be evaluated at compile-time
208- --> $DIR/variadic-ffi-semantic-restrictions.rs:30 :43
222+ --> $DIR/variadic-ffi-semantic-restrictions.rs:33 :43
209223 |
210224LL | const unsafe extern "C" fn f4_1(x: isize, ...) {}
211225 | ^^^ - value is dropped here
212226 | |
213227 | the destructor for this type cannot be evaluated in constant functions
214228
215229error[E0493]: destructor of `VaListImpl<'_>` cannot be evaluated at compile-time
216- --> $DIR/variadic-ffi-semantic-restrictions.rs:34 :36
230+ --> $DIR/variadic-ffi-semantic-restrictions.rs:37 :36
217231 |
218232LL | const extern "C" fn f4_2(x: isize, ...) {}
219233 | ^^^ - value is dropped here
220234 | |
221235 | the destructor for this type cannot be evaluated in constant functions
222236
223237error[E0493]: destructor of `VaListImpl<'_>` cannot be evaluated at compile-time
224- --> $DIR/variadic-ffi-semantic-restrictions.rs:62 :29
238+ --> $DIR/variadic-ffi-semantic-restrictions.rs:65 :29
225239 |
226240LL | const fn i_f5(x: isize, ...) {}
227241 | ^^^ - value is dropped here
228242 | |
229243 | the destructor for this type cannot be evaluated in constant functions
230244
231- error: aborting due to 32 previous errors
245+ error: aborting due to 33 previous errors
232246
233247For more information about this error, try `rustc --explain E0493`.
0 commit comments