From: Philip Herron <[email protected]>

Getting close to getting rid of can_eq and tyty-cmp soon.

gcc/rust/ChangeLog:

        * typecheck/rust-hir-path-probe.cc 
(PathProbeType::process_impl_item_candidate):
        refactor to types_compatable

Signed-off-by: Philip Herron <[email protected]>
---
 gcc/rust/typecheck/rust-hir-path-probe.cc | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/gcc/rust/typecheck/rust-hir-path-probe.cc 
b/gcc/rust/typecheck/rust-hir-path-probe.cc
index bd42e906b4d..59118e6e685 100644
--- a/gcc/rust/typecheck/rust-hir-path-probe.cc
+++ b/gcc/rust/typecheck/rust-hir-path-probe.cc
@@ -302,11 +302,10 @@ PathProbeType::process_impl_item_candidate (HirId id, 
HIR::ImplItem *item,
   if (!query_type (impl_ty_id, &impl_block_ty))
     return;
 
-  if (!receiver->can_eq (impl_block_ty, false))
-    {
-      if (!impl_block_ty->can_eq (receiver, false))
-       return;
-    }
+  if (!types_compatable (TyTy::TyWithLocation (receiver),
+                        TyTy::TyWithLocation (impl_block_ty),
+                        impl->get_locus (), false))
+    return;
 
   // lets visit the impl_item
   item->accept_vis (*this);
-- 
2.50.1

Reply via email to