about summary refs log tree commit diff
path: root/tests/ui/error-codes
diff options
context:
space:
mode:
authorMatthias Krüger <476013+matthiaskrgr@users.noreply.github.com>2025-06-14 11:27:11 +0200
committerGitHub <noreply@github.com>2025-06-14 11:27:11 +0200
commitfe54c3a5eba611dd9b7f875931f484a7ceef4df2 (patch)
tree37021ce0035ac6127149c38d378eb3f64a35136a /tests/ui/error-codes
parent4cf4473b8503c20a8885e5486bd7275dfb5f710e (diff)
parent963fdbc8521839baf833e007e8135794fd1d49d2 (diff)
downloadrust-fe54c3a5eba611dd9b7f875931f484a7ceef4df2.tar.gz
rust-fe54c3a5eba611dd9b7f875931f484a7ceef4df2.zip
Rollup merge of #142464 - RalfJung:variadic-fn-abi-error, r=workingjubilee
variadic functions: remove list of supported ABIs from error

I think this list is problematic for multiple reasons:
- It is bound to go out-of-date as it is in a very different place from where we actually define which functions support varagrs (`fn supports_varargs`).
- Many of the ABIs we list only work on some targets; it makes no sense to mention "aapcs" as a possible ABI when building for x86_64. (This led to a lot of confusion in https://github.com/rust-lang/rust/issues/110505 where the author thought they should use "cdecl" and then were promptly told that "cdecl" is not a legal ABI on their target.)
- Typically, when the programmer wrote `extern "foobar"`, it is because they need the "foobar" ABI. It is of little use to tell them that there are other ABIs with which varargs would work.

Cc ``@workingjubilee``
Diffstat (limited to 'tests/ui/error-codes')
-rw-r--r--tests/ui/error-codes/E0045.stderr2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/ui/error-codes/E0045.stderr b/tests/ui/error-codes/E0045.stderr
index b8ee31a4049..ecf5f4e0182 100644
--- a/tests/ui/error-codes/E0045.stderr
+++ b/tests/ui/error-codes/E0045.stderr
@@ -1,4 +1,4 @@
-error[E0045]: C-variadic function must have a compatible calling convention, like `C`, `cdecl`, `system`, `aapcs`, `win64`, `sysv64` or `efiapi`
+error[E0045]: C-variadic functions with the "Rust" calling convention are not supported
   --> $DIR/E0045.rs:1:17
    |
 LL | extern "Rust" { fn foo(x: u8, ...); }