rust/tests/ui/c-variadic
Matthias Krüger 185926c99f
Rollup merge of #146434 - folkertdev:c-variadic-inherent-methods, r=workingjubilee
c-variadic: allow c-variadic inherent and trait methods

tracking issue: https://github.com/rust-lang/rust/issues/44930

Continuing the work of https://github.com/rust-lang/rust/pull/146342, allow inherent and trait methods to be c-variadic. However, a trait that contains a c-variadic method is no longer dyn-compatible.

There is, presumably, some way to make c-variadic methods dyn-compatible. However currently, we don't have confidence that it'll work reliably: when methods from a `dyn` object are cast to a function pointer, a `ReifyShim` is created. If that shim is c-variadic, it would need to forward the C variable argument list.

That does appear to work, because the `va_list` is not represented in MIR at all in this case, so the registers from the call site are untouched by the shim and can be read by the actual implementation. That just does not seem like a solid implementation.

Also, intuitively, why would c-variadic function, primarily needed for FFI, need to be used with `dyn` objects at all? We can revisit this limitation if a need arises.

r? `@workingjubilee`
2025-09-18 17:20:56 +02:00
..
fn-item-diagnostic-issue-69232.rs bless the tests and add a new one 2024-11-29 00:45:14 +01:00
fn-item-diagnostic-issue-69232.stderr bless the tests and add a new one 2024-11-29 00:45:14 +01:00
inherent-method.rs c-variadic: allow inherent methods to be c-variadic 2025-09-11 10:18:48 +02:00
issue-32201.rs bless the tests and add a new one 2024-11-29 00:45:14 +01:00
issue-32201.stderr bless the tests and add a new one 2024-11-29 00:45:14 +01:00
issue-86053-1.rs c-variadic: reject non-extern functions 2025-09-08 19:18:21 +02:00
issue-86053-1.stderr c-variadic: reject functions with unsupported extern ABI 2025-09-09 21:38:38 +02:00
issue-86053-2.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-86053-2.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
naked.rs c-variadic: test ... with naked functions 2025-09-13 21:05:12 +02:00
no-closure.rs Detect top-level ... in argument type 2025-09-16 11:38:08 -07:00
no-closure.stderr Detect top-level ... in argument type 2025-09-16 11:38:08 -07:00
not-async.rs c-variadic: allow inherent methods to be c-variadic 2025-09-11 10:18:48 +02:00
not-async.stderr c-variadic: allow inherent methods to be c-variadic 2025-09-11 10:18:48 +02:00
not-dyn-compatible.rs c-variadic: allow trait methods to be c-variadic 2025-09-11 10:27:28 +02:00
not-dyn-compatible.stderr c-variadic: allow trait methods to be c-variadic 2025-09-11 10:27:28 +02:00
same-program-multiple-abis-arm.rs stabilize extended_varargs_abi_support 2025-09-02 08:48:12 +02:00
same-program-multiple-abis-x86_64.rs stabilize extended_varargs_abi_support 2025-09-02 08:48:12 +02:00
trait-method.rs c-variadic: allow trait methods to be c-variadic 2025-09-11 10:27:28 +02:00
unsupported-abi.rs c-variadic: test that unsupported c-variadic ABIs are reported correctly 2025-09-11 23:55:45 +02:00
unsupported-abi.stderr c-variadic: test that unsupported c-variadic ABIs are reported correctly 2025-09-11 23:55:45 +02:00
valid.rs test valid cases of c-variadic function definitions 2025-09-03 18:29:35 +02:00
variadic-ffi-1.rs add codegen test for variadics (also replacing some existing does-this-build tests) 2025-07-23 14:19:14 +02:00
variadic-ffi-1.stderr add codegen test for variadics (also replacing some existing does-this-build tests) 2025-07-23 14:19:14 +02:00
variadic-ffi-4.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
variadic-ffi-4.stderr best_blame_constraint: don't filter constraints by sup SCC 2025-01-06 16:08:29 -08:00
variadic-ffi-6.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
variadic-ffi-6.stderr Rollup merge of #117914 - estebank:issue-85843, r=wesleywiser 2023-12-12 17:40:53 +01:00
variadic-ffi-no-fixed-args.rs Update Tests 2024-04-16 18:15:37 -04:00
variadic-unreachable-arg-error.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00