Skip to content

Commit 0e7eef6

Browse files
committed
Make the can equal interface more permissive with associated types
1 parent e7e6527 commit 0e7eef6

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

gcc/rust/typecheck/rust-tyty-cmp.h

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,19 @@ class BaseCmp : public TyConstVisitor
4343
return ok;
4444
}
4545
}
46-
else if (other->get_kind () == TypeKind::PLACEHOLDER)
46+
if (other->get_kind () == TypeKind::PLACEHOLDER)
4747
{
4848
const PlaceholderType *p = static_cast<const PlaceholderType *> (other);
4949
if (p->can_resolve ())
5050
{
51-
const BaseType *resolved = p->resolve ();
52-
resolved->accept_vis (*this);
53-
return ok;
51+
other = p->resolve ();
5452
}
5553
}
54+
if (other->get_kind () == TypeKind::PROJECTION)
55+
{
56+
const ProjectionType *p = static_cast<const ProjectionType *> (other);
57+
other = p->get ();
58+
}
5659

5760
other->accept_vis (*this);
5861
return ok;

0 commit comments

Comments
 (0)