]>
git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: Extract helper lookup_associated_impl_block
This will look for a specified predicate that is associated with it so we
might have the predicate Foo<u16, i32> which would refer to:
impl Foo<i32> for u16 {}
This is a general helper which can be used in several places.
gcc/rust/ChangeLog:
* typecheck/rust-hir-trait-reference.cc (AssociatedImplTrait::AssociatedImplTrait):
bind the predicate
(AssociatedImplTrait::get_trait): remove
(AssociatedImplTrait::get_predicate): new getter
* typecheck/rust-hir-trait-reference.h: bind predicate
* typecheck/rust-hir-type-check-item.cc: update ctor
* typecheck/rust-type-util.cc (lookup_associated_impl_block): new function
* typecheck/rust-type-util.h (class BaseType): remove unused forward decl
(lookup_associated_impl_block): new helper
* typecheck/rust-tyty-bounds.cc (TypeBoundPredicate::is_equal): new
* typecheck/rust-tyty-subst.cc (SubstitutionRef::lookup_associated_impl): use new helper
(SubstitutionRef::monomorphize): update usage/error handling
* typecheck/rust-tyty-subst.h: remove old prototype
* typecheck/rust-tyty.h: add is_equal decl
Signed-off-by: Philip Herron <herron.philip@googlemail.com>