]> git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: Remove monomorphization hack to setup possible associated types
authorPhilip Herron <herron.philip@googlemail.com>
Fri, 27 Jan 2023 15:38:58 +0000 (15:38 +0000)
committerPhilip Herron <herron.philip@googlemail.com>
Sun, 5 Feb 2023 00:10:48 +0000 (00:10 +0000)
commitedcf5b63bf60c1aec18df315fffbcd3d59d23119
tree18d4727bded65c9fecf5ee1c783c7730be6c17cb
parentb5719d74b349bf96735851844158ea9b5d65db85
gccrs: Remove monomorphization hack to setup possible associated types

During CallExpr argument type checking we may be calling a default
implementation of a trait function this will require any possible
associated types to be resolved and setup. This monomoprhization call does
this but it will premtivly do extra unification of types which will throw
off type checking later on. This fix is required for my work into type
bounds checking.

Fixes #1773

Signed-off-by: Philip Herron <herron.philip@googlemail.com>
gcc/rust/ChangeLog:

* typecheck/rust-hir-trait-reference.h: change interface to return self
* typecheck/rust-hir-trait-resolve.cc: likewise
* typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_segments): likewise
* typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit): remove monomorphization hack

gcc/testsuite/ChangeLog:

* rust/compile/issue-1773.rs: New test.
gcc/rust/typecheck/rust-hir-trait-reference.h
gcc/rust/typecheck/rust-hir-trait-resolve.cc
gcc/rust/typecheck/rust-hir-type-check-path.cc
gcc/rust/typecheck/rust-tyty-call.cc
gcc/testsuite/rust/compile/issue-1773.rs [new file with mode: 0644]