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>