@@ -201,6 +201,42 @@ error: only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` function
201201LL | fn t_f6(..., x: isize);
202202 | ^^^
203203
204+ error: foreign functions with a C-variadic argument cannot be safe
205+ --> $DIR/variadic-ffi-semantic-restrictions.rs:88:5
206+ |
207+ LL | safe fn s_f1(...);
208+ | ^^^^^
209+ |
210+ help: remove the `safe` keyword from this definition
211+ |
212+ LL - safe fn s_f1(...);
213+ LL + fn s_f1(...);
214+ |
215+
216+ error: foreign functions with a C-variadic argument cannot be safe
217+ --> $DIR/variadic-ffi-semantic-restrictions.rs:90:5
218+ |
219+ LL | safe fn printf(format: *const u8, ...);
220+ | ^^^^^
221+ |
222+ help: remove the `safe` keyword from this definition
223+ |
224+ LL - safe fn printf(format: *const u8, ...);
225+ LL + fn printf(format: *const u8, ...);
226+ |
227+
228+ error: foreign functions with a C-variadic argument cannot be safe
229+ --> $DIR/variadic-ffi-semantic-restrictions.rs:92:5
230+ |
231+ LL | safe fn snprintf(s: *mut u8, n: usize, format: *const u8, ...);
232+ | ^^^^^
233+ |
234+ help: remove the `safe` keyword from this definition
235+ |
236+ LL - safe fn snprintf(s: *mut u8, n: usize, format: *const u8, ...);
237+ LL + fn snprintf(s: *mut u8, n: usize, format: *const u8, ...);
238+ |
239+
204240error[E0493]: destructor of `VaListImpl<'_>` cannot be evaluated at compile-time
205241 --> $DIR/variadic-ffi-semantic-restrictions.rs:32:43
206242 |
@@ -225,6 +261,6 @@ LL | const fn i_f5(x: isize, ...) {}
225261 | |
226262 | the destructor for this type cannot be evaluated in constant functions
227263
228- error: aborting due to 36 previous errors
264+ error: aborting due to 39 previous errors
229265
230266For more information about this error, try `rustc --explain E0493`.
0 commit comments