diff options
| author | Matthias Krüger <476013+matthiaskrgr@users.noreply.github.com> | 2025-09-10 20:29:10 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-10 20:29:10 +0200 |
| commit | bb45ea3accf536e0915991c5d9120bab8a87541e (patch) | |
| tree | 301e5c15dcb2f6f64faf288a1fe2a1db1eaac790 /tests/ui/mir/issue-83499-input-output-iteration-ice.rs | |
| parent | 86d39a06734cae9492d83498aac9bbdf3aa20508 (diff) | |
| parent | 9196844f0d86242ee3d6a446fe681b6b2d2d674c (diff) | |
| download | rust-bb45ea3accf536e0915991c5d9120bab8a87541e.tar.gz rust-bb45ea3accf536e0915991c5d9120bab8a87541e.zip | |
Rollup merge of #146342 - folkertdev:c-variadic-errors-take-3, r=workingjubilee
Improve C-variadic error messages: part 2 tracking issue: https://github.com/rust-lang/rust/issues/44930 a reimplementation of https://github.com/rust-lang/rust/pull/143546 that builds on https://github.com/rust-lang/rust/pull/146165. This PR - disallows coroutines (e.g. `async fn`) from having a `...` argument - disallows associated functions (both in traits and standard impl blocks) from having a `...` argument - splits up a generic "ill-formed C-variadic function" into specific errors about using an incorrect ABI, not specifying an ABI, or missing the unsafe keyword C-variadic coroutines probably don't make sense? C-variadic functions are for FFI purposes, combining that with async functions seems weird. For associated functions, we're just cutting scope. It's probably fine, but it's probably better to explicitly allow it. So for now, at least give a more targeted error message. Made to be reviewed commit-by-commit. cc `@workingjubilee` r? compiler
Diffstat (limited to 'tests/ui/mir/issue-83499-input-output-iteration-ice.rs')
| -rw-r--r-- | tests/ui/mir/issue-83499-input-output-iteration-ice.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/ui/mir/issue-83499-input-output-iteration-ice.rs b/tests/ui/mir/issue-83499-input-output-iteration-ice.rs index 9277994d9b3..dc0d14bf9d6 100644 --- a/tests/ui/mir/issue-83499-input-output-iteration-ice.rs +++ b/tests/ui/mir/issue-83499-input-output-iteration-ice.rs @@ -4,7 +4,6 @@ fn main() {} -fn foo(_: Bar, ...) -> impl {} -//~^ ERROR defining functions with C-variadic arguments is only allowed for free functions with the "C" or "C-unwind" calling convention -//~| ERROR cannot find type `Bar` in this scope +unsafe extern "C" fn foo(_: Bar, ...) -> impl {} +//~^ ERROR cannot find type `Bar` in this scope //~| ERROR at least one trait must be specified |
