2025-09-06 17:23:34 +02:00
|
|
|
error: `...` is not supported for non-extern functions
|
2021-03-08 15:43:18 -08:00
|
|
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:6:19
|
2019-12-02 02:38:33 +01:00
|
|
|
|
|
2019-12-02 03:16:12 +01:00
|
|
|
LL | fn f1_1(x: isize, ...) {}
|
2020-09-26 13:46:00 -04:00
|
|
|
| ^^^
|
2019-12-02 03:16:12 +01:00
|
|
|
|
2025-09-06 17:23:34 +02:00
|
|
|
error: `...` is not supported for non-extern functions
|
2021-03-08 15:43:18 -08:00
|
|
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:9:9
|
2019-12-02 03:16:12 +01:00
|
|
|
|
|
|
|
|
|
LL | fn f1_2(...) {}
|
2020-09-26 13:46:00 -04:00
|
|
|
| ^^^
|
2019-12-02 03:16:12 +01:00
|
|
|
|
2025-08-28 12:03:19 +02:00
|
|
|
error: defining functions with C-variadic arguments is only allowed for free functions with the "C" or "C-unwind" calling convention
|
2024-04-16 18:15:37 -04:00
|
|
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:12:30
|
2019-12-02 03:16:12 +01:00
|
|
|
|
|
|
|
|
|
LL | extern "C" fn f2_1(x: isize, ...) {}
|
2020-09-26 13:46:00 -04:00
|
|
|
| ^^^
|
2019-12-02 03:16:12 +01:00
|
|
|
|
2025-08-28 12:03:19 +02:00
|
|
|
error: defining functions with C-variadic arguments is only allowed for free functions with the "C" or "C-unwind" calling convention
|
2024-04-16 18:15:37 -04:00
|
|
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:15:20
|
2019-12-02 03:16:12 +01:00
|
|
|
|
|
|
|
|
|
LL | extern "C" fn f2_2(...) {}
|
2020-09-26 13:46:00 -04:00
|
|
|
| ^^^
|
2019-12-02 03:16:12 +01:00
|
|
|
|
|
|
|
|
error: `...` must be the last argument of a C-variadic function
|
2024-04-16 18:15:37 -04:00
|
|
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:18:20
|
2019-12-02 03:16:12 +01:00
|
|
|
|
|
|
|
|
|
LL | extern "C" fn f2_3(..., x: isize) {}
|
2020-09-26 13:46:00 -04:00
|
|
|
| ^^^
|
2019-12-02 03:16:12 +01:00
|
|
|
|
2025-08-28 12:03:19 +02:00
|
|
|
error: defining functions with C-variadic arguments is only allowed for free functions with the "C" or "C-unwind" calling convention
|
2025-09-03 16:56:13 +02:00
|
|
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:21:30
|
2019-12-02 02:38:33 +01:00
|
|
|
|
|
2020-09-01 17:12:52 -04:00
|
|
|
LL | extern "C" fn f3_1(x: isize, ...) {}
|
|
|
|
|
| ^^^
|
2019-12-02 03:16:12 +01:00
|
|
|
|
2025-08-28 12:03:19 +02:00
|
|
|
error: defining functions with C-variadic arguments is only allowed for free functions with the "C" or "C-unwind" calling convention
|
2025-09-03 16:56:13 +02:00
|
|
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:24:20
|
2019-12-02 03:16:12 +01:00
|
|
|
|
|
2020-09-01 17:12:52 -04:00
|
|
|
LL | extern "C" fn f3_2(...) {}
|
|
|
|
|
| ^^^
|
2019-12-02 03:16:12 +01:00
|
|
|
|
|
|
|
|
error: `...` must be the last argument of a C-variadic function
|
2025-09-03 16:56:13 +02:00
|
|
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:27:20
|
2019-12-02 03:16:12 +01:00
|
|
|
|
|
2020-09-01 17:12:52 -04:00
|
|
|
LL | extern "C" fn f3_3(..., x: isize) {}
|
|
|
|
|
| ^^^
|
2019-12-02 03:16:12 +01:00
|
|
|
|
2023-10-29 17:28:56 -04:00
|
|
|
error: functions cannot be both `const` and C-variadic
|
2025-09-03 16:56:13 +02:00
|
|
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:30:1
|
2023-10-29 17:28:56 -04:00
|
|
|
|
|
|
|
|
|
LL | const unsafe extern "C" fn f4_1(x: isize, ...) {}
|
|
|
|
|
| ^^^^^ `const` because of this ^^^ C-variadic because of this
|
|
|
|
|
|
|
|
|
|
error: functions cannot be both `const` and C-variadic
|
2025-09-03 16:56:13 +02:00
|
|
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:34:1
|
2023-10-29 17:28:56 -04:00
|
|
|
|
|
|
|
|
|
LL | const extern "C" fn f4_2(x: isize, ...) {}
|
|
|
|
|
| ^^^^^ `const` because of this ^^^ C-variadic because of this
|
|
|
|
|
|
2025-08-28 12:03:19 +02:00
|
|
|
error: defining functions with C-variadic arguments is only allowed for free functions with the "C" or "C-unwind" calling convention
|
2025-09-03 16:56:13 +02:00
|
|
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:34:36
|
2023-10-29 17:28:56 -04:00
|
|
|
|
|
|
|
|
|
LL | const extern "C" fn f4_2(x: isize, ...) {}
|
|
|
|
|
| ^^^
|
|
|
|
|
|
|
|
|
|
error: `...` must be the last argument of a C-variadic function
|
2025-09-03 16:56:13 +02:00
|
|
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:39:26
|
2023-10-29 17:28:56 -04:00
|
|
|
|
|
|
|
|
|
LL | const extern "C" fn f4_3(..., x: isize, ...) {}
|
|
|
|
|
| ^^^
|
|
|
|
|
|
|
|
|
|
error: functions cannot be both `const` and C-variadic
|
2025-09-03 16:56:13 +02:00
|
|
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:39:1
|
2023-10-29 17:28:56 -04:00
|
|
|
|
|
|
|
|
|
LL | const extern "C" fn f4_3(..., x: isize, ...) {}
|
2025-09-03 16:56:13 +02:00
|
|
|
| ^^^^^ `const` because of this ^^^ C-variadic because of this
|
2023-10-29 17:28:56 -04:00
|
|
|
|
2025-08-28 12:03:19 +02:00
|
|
|
error: defining functions with C-variadic arguments is only allowed for free functions with the "C" or "C-unwind" calling convention
|
2025-09-03 16:56:13 +02:00
|
|
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:39:41
|
2023-10-29 17:28:56 -04:00
|
|
|
|
|
|
|
|
|
LL | const extern "C" fn f4_3(..., x: isize, ...) {}
|
2025-09-03 16:56:13 +02:00
|
|
|
| ^^^
|
2023-10-29 17:28:56 -04:00
|
|
|
|
2019-12-02 03:16:12 +01:00
|
|
|
error: `...` must be the last argument of a C-variadic function
|
2025-09-03 16:56:13 +02:00
|
|
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:45:13
|
2019-12-02 03:16:12 +01:00
|
|
|
|
|
|
|
|
|
LL | fn e_f2(..., x: isize);
|
2020-09-26 13:46:00 -04:00
|
|
|
| ^^^
|
2019-12-02 03:16:12 +01:00
|
|
|
|
2025-09-06 15:13:02 +02:00
|
|
|
error: associated functions cannot have a C variable argument list
|
2025-09-03 16:56:13 +02:00
|
|
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:52:23
|
2019-12-02 03:16:12 +01:00
|
|
|
|
|
|
|
|
|
LL | fn i_f1(x: isize, ...) {}
|
2020-09-26 13:46:00 -04:00
|
|
|
| ^^^
|
2019-12-02 03:16:12 +01:00
|
|
|
|
2025-09-06 15:13:02 +02:00
|
|
|
error: associated functions cannot have a C variable argument list
|
2025-09-03 16:56:13 +02:00
|
|
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:54:13
|
2019-12-02 03:16:12 +01:00
|
|
|
|
|
|
|
|
|
LL | fn i_f2(...) {}
|
2020-09-26 13:46:00 -04:00
|
|
|
| ^^^
|
2019-12-02 03:16:12 +01:00
|
|
|
|
|
|
|
|
error: `...` must be the last argument of a C-variadic function
|
2025-09-03 16:56:13 +02:00
|
|
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:56:13
|
2019-12-02 03:16:12 +01:00
|
|
|
|
|
|
|
|
|
LL | fn i_f3(..., x: isize, ...) {}
|
2020-09-26 13:46:00 -04:00
|
|
|
| ^^^
|
2019-12-02 03:16:12 +01:00
|
|
|
|
2025-09-06 15:13:02 +02:00
|
|
|
error: associated functions cannot have a C variable argument list
|
2025-09-03 16:56:13 +02:00
|
|
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:56:28
|
2019-12-02 03:16:12 +01:00
|
|
|
|
|
|
|
|
|
LL | fn i_f3(..., x: isize, ...) {}
|
2025-09-03 16:56:13 +02:00
|
|
|
| ^^^
|
2019-12-02 02:38:33 +01:00
|
|
|
|
2019-12-02 03:16:12 +01:00
|
|
|
error: `...` must be the last argument of a C-variadic function
|
2025-09-03 16:56:13 +02:00
|
|
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:59:13
|
2019-12-02 02:38:33 +01:00
|
|
|
|
|
2019-12-02 03:16:12 +01:00
|
|
|
LL | fn i_f4(..., x: isize, ...) {}
|
2020-09-26 13:46:00 -04:00
|
|
|
| ^^^
|
2019-12-02 03:16:12 +01:00
|
|
|
|
2025-09-06 15:13:02 +02:00
|
|
|
error: associated functions cannot have a C variable argument list
|
2025-09-03 16:56:13 +02:00
|
|
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:59:28
|
2019-12-02 03:16:12 +01:00
|
|
|
|
|
|
|
|
|
LL | fn i_f4(..., x: isize, ...) {}
|
2025-09-03 16:56:13 +02:00
|
|
|
| ^^^
|
2019-12-02 02:38:33 +01:00
|
|
|
|
2023-10-29 17:28:56 -04:00
|
|
|
error: functions cannot be both `const` and C-variadic
|
2025-09-03 16:56:13 +02:00
|
|
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:62:5
|
2023-10-29 17:28:56 -04:00
|
|
|
|
|
|
|
|
|
LL | const fn i_f5(x: isize, ...) {}
|
|
|
|
|
| ^^^^^ ^^^ C-variadic because of this
|
|
|
|
|
| |
|
|
|
|
|
| `const` because of this
|
|
|
|
|
|
2025-09-06 15:13:02 +02:00
|
|
|
error: associated functions cannot have a C variable argument list
|
2025-09-03 16:56:13 +02:00
|
|
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:62:29
|
2023-10-29 17:28:56 -04:00
|
|
|
|
|
|
|
|
|
LL | const fn i_f5(x: isize, ...) {}
|
|
|
|
|
| ^^^
|
|
|
|
|
|
2025-09-06 15:13:02 +02:00
|
|
|
error: associated functions cannot have a C variable argument list
|
2025-09-03 16:56:13 +02:00
|
|
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:69:23
|
2019-12-02 02:38:33 +01:00
|
|
|
|
|
2019-12-02 03:16:12 +01:00
|
|
|
LL | fn t_f1(x: isize, ...) {}
|
2020-09-26 13:46:00 -04:00
|
|
|
| ^^^
|
2019-12-02 02:38:33 +01:00
|
|
|
|
2025-09-06 15:13:02 +02:00
|
|
|
error: associated functions cannot have a C variable argument list
|
2025-09-03 16:56:13 +02:00
|
|
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:71:23
|
2019-12-02 03:16:12 +01:00
|
|
|
|
|
|
|
|
|
LL | fn t_f2(x: isize, ...);
|
2020-09-26 13:46:00 -04:00
|
|
|
| ^^^
|
2019-12-02 03:16:12 +01:00
|
|
|
|
2025-09-06 15:13:02 +02:00
|
|
|
error: associated functions cannot have a C variable argument list
|
2025-09-03 16:56:13 +02:00
|
|
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:73:13
|
2019-12-02 03:16:12 +01:00
|
|
|
|
|
|
|
|
|
LL | fn t_f3(...) {}
|
2020-09-26 13:46:00 -04:00
|
|
|
| ^^^
|
2019-12-02 03:16:12 +01:00
|
|
|
|
2025-09-06 15:13:02 +02:00
|
|
|
error: associated functions cannot have a C variable argument list
|
2025-09-03 16:56:13 +02:00
|
|
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:75:13
|
2019-12-02 03:16:12 +01:00
|
|
|
|
|
|
|
|
|
LL | fn t_f4(...);
|
2020-09-26 13:46:00 -04:00
|
|
|
| ^^^
|
2019-12-02 03:16:12 +01:00
|
|
|
|
|
|
|
|
error: `...` must be the last argument of a C-variadic function
|
2025-09-03 16:56:13 +02:00
|
|
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:77:13
|
2019-12-02 03:16:12 +01:00
|
|
|
|
|
|
|
|
|
LL | fn t_f5(..., x: isize) {}
|
2020-09-26 13:46:00 -04:00
|
|
|
| ^^^
|
2019-12-02 03:16:12 +01:00
|
|
|
|
|
|
|
|
error: `...` must be the last argument of a C-variadic function
|
2025-09-03 16:56:13 +02:00
|
|
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:79:13
|
2019-12-02 02:38:33 +01:00
|
|
|
|
|
2019-12-02 03:16:12 +01:00
|
|
|
LL | fn t_f6(..., x: isize);
|
2020-09-26 13:46:00 -04:00
|
|
|
| ^^^
|
2019-12-02 02:38:33 +01:00
|
|
|
|
2024-02-01 22:45:00 +00:00
|
|
|
error[E0493]: destructor of `VaListImpl<'_>` cannot be evaluated at compile-time
|
2025-09-03 16:56:13 +02:00
|
|
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:30:43
|
2024-02-01 22:45:00 +00:00
|
|
|
|
|
|
|
|
|
LL | const unsafe extern "C" fn f4_1(x: isize, ...) {}
|
|
|
|
|
| ^^^ - value is dropped here
|
|
|
|
|
| |
|
|
|
|
|
| the destructor for this type cannot be evaluated in constant functions
|
|
|
|
|
|
|
|
|
|
error[E0493]: destructor of `VaListImpl<'_>` cannot be evaluated at compile-time
|
2025-09-03 16:56:13 +02:00
|
|
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:34:36
|
2024-02-01 22:45:00 +00:00
|
|
|
|
|
|
|
|
|
LL | const extern "C" fn f4_2(x: isize, ...) {}
|
|
|
|
|
| ^^^ - value is dropped here
|
|
|
|
|
| |
|
|
|
|
|
| the destructor for this type cannot be evaluated in constant functions
|
|
|
|
|
|
|
|
|
|
error[E0493]: destructor of `VaListImpl<'_>` cannot be evaluated at compile-time
|
2025-09-03 16:56:13 +02:00
|
|
|
--> $DIR/variadic-ffi-semantic-restrictions.rs:62:29
|
2024-02-01 22:45:00 +00:00
|
|
|
|
|
|
|
|
|
LL | const fn i_f5(x: isize, ...) {}
|
|
|
|
|
| ^^^ - value is dropped here
|
|
|
|
|
| |
|
|
|
|
|
| the destructor for this type cannot be evaluated in constant functions
|
|
|
|
|
|
2025-09-03 16:56:13 +02:00
|
|
|
error: aborting due to 32 previous errors
|
2019-12-02 02:38:33 +01:00
|
|
|
|
2024-02-01 22:45:00 +00:00
|
|
|
For more information about this error, try `rustc --explain E0493`.
|