]> git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: improve error diagnostic for bad type-resolution in CallExpr
authorPhilip Herron <herron.philip@googlemail.com>
Fri, 14 Feb 2025 17:32:20 +0000 (17:32 +0000)
committerArthur Cohen <arthur.cohen@embecosm.com>
Mon, 24 Mar 2025 12:07:06 +0000 (13:07 +0100)
commit093ae1547cbaf1b818b96d25d1d0235b69255c24
treeb25ae255dd4bb1e1e8e787bdb3c842a7990f793f
parent3ac3c6f90f272ac9a51031ea45f1d867712a1b23
gccrs: improve error diagnostic for bad type-resolution in CallExpr

We have the type information for the resolved call lets tell the user about
it in the diagnostic and apply the correct error code.

Fixes Rust-GCC#2035

gcc/rust/ChangeLog:

* typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): improve error diag

gcc/testsuite/ChangeLog:

* rust/compile/generics4.rs: cleanup
* rust/compile/generics6.rs: likewise
* rust/compile/type-bindings1.rs: likewise
* rust/compile/unconstrained_type_param.rs: likewise
* rust/compile/issue-2035.rs: New test.

Signed-off-by: Philip Herron <herron.philip@googlemail.com>
gcc/rust/typecheck/rust-hir-type-check-expr.cc
gcc/testsuite/rust/compile/generics4.rs
gcc/testsuite/rust/compile/generics6.rs
gcc/testsuite/rust/compile/issue-2035.rs [new file with mode: 0644]
gcc/testsuite/rust/compile/type-bindings1.rs
gcc/testsuite/rust/compile/unconstrained_type_param.rs