From 13556413e3841460d88c7a63c8a3049399f6b28e Mon Sep 17 00:00:00 2001 From: Philip Herron Date: Thu, 6 Oct 2022 14:46:17 +0100 Subject: gccrs: Support type resolution on super traits on dyn objects When checking if specified bounds satisfy other bounds we must lookup the super traits. To finish the support for super traits we need to redo the computation of method addresses to support super traits. Addresses #914 gcc/rust/ChangeLog: * backend/rust-compile.cc: Add note about missing support for super traits. * typecheck/rust-tyty.cc (BaseType::satisfies_bound): New function. (BaseType::bounds_compatible): New function. (DynamicObjectType::get_object_items): New function. * typecheck/rust-hir-trait-ref.h: Use new API to perform type resolution on dyn objects. --- gcc/rust/backend/rust-compile.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gcc/rust/backend') diff --git a/gcc/rust/backend/rust-compile.cc b/gcc/rust/backend/rust-compile.cc index 13f4243..db08b3d 100644 --- a/gcc/rust/backend/rust-compile.cc +++ b/gcc/rust/backend/rust-compile.cc @@ -247,6 +247,8 @@ HIRCompileBase::compute_address_for_trait_item ( // Algo: // check if there is an impl-item for this trait-item-ref first // else assert that the trait-item-ref has an implementation + // + // FIXME this does not support super traits TyTy::TypeBoundPredicateItem predicate_item = predicate->lookup_associated_item (ref->get_identifier ()); -- cgit v1.1