]> git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: [E0617] attempt for invalid type variable in variadic function
authorMuhammad Mahad <mahadtxt@gmail.com>
Sun, 17 Sep 2023 11:58:51 +0000 (16:58 +0500)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 18:04:37 +0000 (19:04 +0100)
commit718b65a93d194a97a88f96780b97023ce9ed9378
treec32bda7796d429dffc97998569cbc77c18cd039e
parent95703bb75efc3ca0300b78ab9d3f4d544faad4b6
gccrs: [E0617] attempt for invalid type variable in variadic function

There are some certain rust types must be cast before
passing them to a variadic function, because of arcane
ABI rules dictated by the C standard. To fix the error,
cast the value to the type specified by the error message.

gcc/rust/ChangeLog:

* typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit):
Added ErrorCode & more fixit hints.

gcc/testsuite/ChangeLog:

* rust/compile/variadic.rs: Added new checks.

Signed-off-by: Muhammad Mahad <mahadtxt@gmail.com>
gcc/rust/typecheck/rust-tyty-call.cc
gcc/testsuite/rust/compile/variadic.rs