]> git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: fix bad type inference on local patterns
authorPhilip Herron <herron.philip@googlemail.com>
Mon, 4 Nov 2024 14:43:25 +0000 (14:43 +0000)
committerArthur Cohen <arthur.cohen@embecosm.com>
Fri, 21 Mar 2025 11:32:55 +0000 (12:32 +0100)
commit389756b2ac97beeb72cd160eeefee5ea381e55e9
treee29f313e3ff5bd327348680aa3dd19a2b0b7120a
parentcbab7a138956c7a83639b501194ca4031289e028
gccrs: fix bad type inference on local patterns

We do not need to inject inference variables on generic patterns
with generic blocks. This will just cause unconstrained inference
variables as they may not unify against something.

Fixes Rust-GCC#2323

gcc/rust/ChangeLog:

* typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_root_path): dont infer here

gcc/testsuite/ChangeLog:

* rust/compile/nr2/exclude: nr2 cant handle this
* rust/compile/issue-2323.rs: New test.

Signed-off-by: Philip Herron <herron.philip@googlemail.com>
gcc/rust/typecheck/rust-hir-type-check-path.cc
gcc/testsuite/rust/compile/issue-2323.rs [new file with mode: 0644]
gcc/testsuite/rust/compile/nr2/exclude