]> 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)
committerPhilip Herron <philip.herron@embecosm.com>
Fri, 14 Feb 2025 18:03:54 +0000 (18:03 +0000)
commitf21bf4bd6c415884c3b24c96a381d9cbc6c1cde2
treef80deb20c2d1f9d17d451b1d95dce168c44526bb
parent1eb46203ced28c5a3e44f6b63a23d4e91bd4f344
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