about summary refs log tree commit diff
path: root/tests/ui/parser/variadic-ffi-semantic-restrictions.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-09-08 13:18:04 +0000
committerbors <bors@rust-lang.org>2025-09-08 13:18:04 +0000
commit68baa87ba6f03f8b6af2a368690161f1601e4040 (patch)
tree072e635ecbfa95d73dfc1e99edd764be303d2115 /tests/ui/parser/variadic-ffi-semantic-restrictions.rs
parentbeeb8e3af54295ba494c250e84ecda4c2c5d85ff (diff)
parent8d11719e6c980232b9e9657a356d3c3c1a35c6da (diff)
downloadrust-68baa87ba6f03f8b6af2a368690161f1601e4040.tar.gz
rust-68baa87ba6f03f8b6af2a368690161f1601e4040.zip
Auto merge of #146165 - folkertdev:c-variadic-errors-take-2, r=lcnr
improve c-variadic error reporting

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

The parts of https://github.com/rust-lang/rust/pull/143546 that don't require any particular knowledge about c-variadic functions.

This prepares the way for rejecting c-variadic functions that are also coroutines, safe functions, or associated functions.
Diffstat (limited to 'tests/ui/parser/variadic-ffi-semantic-restrictions.rs')
-rw-r--r--tests/ui/parser/variadic-ffi-semantic-restrictions.rs12
1 files changed, 4 insertions, 8 deletions
diff --git a/tests/ui/parser/variadic-ffi-semantic-restrictions.rs b/tests/ui/parser/variadic-ffi-semantic-restrictions.rs
index e7a0248cffa..243924e6c53 100644
--- a/tests/ui/parser/variadic-ffi-semantic-restrictions.rs
+++ b/tests/ui/parser/variadic-ffi-semantic-restrictions.rs
@@ -16,8 +16,7 @@ extern "C" fn f2_2(...) {}
 //~^ ERROR defining functions with C-variadic arguments is only allowed for free functions with the "C" or "C-unwind" calling convention
 
 extern "C" fn f2_3(..., x: isize) {}
-//~^ ERROR defining functions with C-variadic arguments is only allowed for free functions with the "C" or "C-unwind" calling convention
-//~| ERROR `...` must be the last argument of a C-variadic function
+//~^ ERROR `...` must be the last argument of a C-variadic function
 
 extern "C" fn f3_1(x: isize, ...) {}
 //~^ ERROR defining functions with C-variadic arguments is only allowed for free functions with the "C" or "C-unwind" calling convention
@@ -26,8 +25,7 @@ extern "C" fn f3_2(...) {}
 //~^ ERROR defining functions with C-variadic arguments is only allowed for free functions with the "C" or "C-unwind" calling convention
 
 extern "C" fn f3_3(..., x: isize) {}
-//~^ ERROR defining functions with C-variadic arguments is only allowed for free functions with the "C" or "C-unwind" calling convention
-//~| ERROR `...` must be the last argument of a C-variadic function
+//~^ ERROR `...` must be the last argument of a C-variadic function
 
 const unsafe extern "C" fn f4_1(x: isize, ...) {}
 //~^ ERROR functions cannot be both `const` and C-variadic
@@ -77,9 +75,7 @@ trait T {
     fn t_f4(...);
     //~^ ERROR defining functions with C-variadic arguments is only allowed for free functions with the "C" or "C-unwind" calling convention
     fn t_f5(..., x: isize) {}
-    //~^ ERROR defining functions with C-variadic arguments is only allowed for free functions with the "C" or "C-unwind" calling convention
-    //~| ERROR `...` must be the last argument of a C-variadic function
+    //~^ ERROR `...` must be the last argument of a C-variadic function
     fn t_f6(..., x: isize);
-    //~^ ERROR defining functions with C-variadic arguments is only allowed for free functions with the "C" or "C-unwind" calling convention
-    //~| ERROR `...` must be the last argument of a C-variadic function
+    //~^ ERROR `...` must be the last argument of a C-variadic function
 }