From 0e7eef6556703cd53b336d0b5280c3696586d431 Mon Sep 17 00:00:00 2001 From: Philip Herron Date: Wed, 30 Mar 2022 14:56:34 +0100 Subject: [PATCH] Make the can equal interface more permissive with associated types --- gcc/rust/typecheck/rust-tyty-cmp.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/gcc/rust/typecheck/rust-tyty-cmp.h b/gcc/rust/typecheck/rust-tyty-cmp.h index 34c89639f6f..9ea49cae820 100644 --- a/gcc/rust/typecheck/rust-tyty-cmp.h +++ b/gcc/rust/typecheck/rust-tyty-cmp.h @@ -43,16 +43,19 @@ public: return ok; } } - else if (other->get_kind () == TypeKind::PLACEHOLDER) + if (other->get_kind () == TypeKind::PLACEHOLDER) { const PlaceholderType *p = static_cast (other); if (p->can_resolve ()) { - const BaseType *resolved = p->resolve (); - resolved->accept_vis (*this); - return ok; + other = p->resolve (); } } + if (other->get_kind () == TypeKind::PROJECTION) + { + const ProjectionType *p = static_cast (other); + other = p->get (); + } other->accept_vis (*this); return ok;