]> git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: Apply generic arguments to the respective trait bounds
authorPhilip Herron <herron.philip@googlemail.com>
Tue, 20 Jun 2023 18:41:42 +0000 (19:41 +0100)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 17:46:28 +0000 (18:46 +0100)
commit97bc533c525629410ffc520170c950af69490afd
tree19e78f4aef444ec42f537adef0970b9fe75214e8
parent5189a22a14c99b9d56c4ce14d7b4d8206caf8dd2
gccrs: Apply generic arguments to the respective trait bounds

When we have an impl block for a generic type such as T which is a generic
type which does not 'bind' generic arguments, which means its not a type
such as an ADT or Fn which holds generic parameter mappings we need to
ensure inference variables are applied to the segment type apropriately so
that inference variables unified correctly and the higher ranked trait
bounds are as well.

Fixes: #1893
gcc/rust/ChangeLog:

* typecheck/rust-hir-type-check-item.cc (TypeCheckItem::ResolveImplBlockSelfWithInference):
arguments mappings as an out parameter and apply them to the bounds
* typecheck/rust-hir-type-check-item.h: update the prototype
* typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_segments):
apply the arguments to the segment type

gcc/testsuite/ChangeLog:

* rust/compile/issue-1893.rs: fully compile the test case

Signed-off-by: Philip Herron <herron.philip@googlemail.com>
gcc/rust/typecheck/rust-hir-type-check-item.cc
gcc/rust/typecheck/rust-hir-type-check-item.h
gcc/rust/typecheck/rust-hir-type-check-path.cc
gcc/testsuite/rust/compile/issue-1893.rs