gccrs: Respect the concrete type when resolving qualifed path types
Concrete types can resolve to assoicated impl blocks which will allow us to
resolve the path to the projection type instead of the placeholder trait
associated type which can change. The projection will be fixed and is
safer to use.
Fixes #2165 #2166
gcc/rust/ChangeLog:
* typecheck/rust-hir-trait-resolve.cc: when the bound is concrete keep the mapping
* typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::visit): add missing call
* typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit): make this the same as paths
gcc/testsuite/ChangeLog:
* rust/compile/issue-2165.rs: New test.
* rust/compile/issue-2166.rs: New test.
Signed-off-by: Philip Herron <herron.philip@googlemail.com>