]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Remove old hack from resolve operator overload
authorPhilip Herron <herron.philip@googlemail.com>
Wed, 3 Sep 2025 09:21:06 +0000 (10:21 +0100)
committerArthur Cohen <arthur.cohen@embecosm.com>
Thu, 30 Oct 2025 20:30:52 +0000 (21:30 +0100)
This was an old chunk of code to try and sort out the Self type on resolving
methods for impl blocks. But this is not required when our unify code works
properly.

gcc/rust/ChangeLog:

* typecheck/rust-hir-type-check-expr.cc: remove old hack

Signed-off-by: Philip Herron <herron.philip@googlemail.com>
gcc/rust/typecheck/rust-hir-type-check-expr.cc

index dc063587e0d80ba99401bd026a9fce5210bd1b8e..05749609a204c21c76c5836ac577bd87b8ffb8a7 100644 (file)
@@ -2034,24 +2034,6 @@ TypeCheckExpr::resolve_operator_overload (
   rust_debug ("is_impl_item_candidate: %s",
              resolved_candidate.is_impl_candidate () ? "true" : "false");
 
-  if (resolved_candidate.is_impl_candidate ())
-    {
-      auto infer_arguments = TyTy::SubstitutionArgumentMappings::error ();
-      HIR::ImplBlock &impl = *resolved_candidate.item.impl.parent;
-      TyTy::BaseType *impl_self_infer
-       = TypeCheckItem::ResolveImplBlockSelfWithInference (impl,
-                                                           expr.get_locus (),
-                                                           &infer_arguments);
-      if (impl_self_infer->get_kind () == TyTy::TypeKind::ERROR)
-       {
-         return false;
-       }
-      if (!infer_arguments.is_empty ())
-       {
-         lookup = SubstMapperInternal::Resolve (lookup, infer_arguments);
-       }
-    }
-
   // in the case where we resolve to a trait bound we have to be careful we are
   // able to do so there is a case where we are currently resolving the deref
   // operator overload function which is generic and this might resolve to the