]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Update can_eq to be a types_compatable interface
authorPhilip Herron <herron.philip@googlemail.com>
Mon, 25 Aug 2025 19:52:29 +0000 (20:52 +0100)
committerArthur Cohen <arthur.cohen@embecosm.com>
Thu, 30 Oct 2025 19:58:55 +0000 (20:58 +0100)
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 <herron.philip@googlemail.com>
gcc/rust/typecheck/rust-hir-path-probe.cc

index bd42e906b4d8c575ee4ed74d2620162cf569a256..59118e6e685ef23d2f92e6f269ecb4b8d2ea7e0a 100644 (file)
@@ -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);