]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: cleanup resolve method address
authorPhilip Herron <herron.philip@googlemail.com>
Tue, 4 Apr 2023 14:24:01 +0000 (15:24 +0100)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 17:28:45 +0000 (18:28 +0100)
Calling PathProbeImplTrait resolves directly to the trait bound in question
to stop resolving to potentially multiple implementations of that bound

gcc/rust/ChangeLog:

* backend/rust-compile-expr.cc (CompileExpr::resolve_method_address):
call path probe impl trait

Signed-off-by: Philip Herron <herron.philip@googlemail.com>
gcc/rust/backend/rust-compile-expr.cc

index e3b012c152716867ca9949622a9bc8f723740864..668f704f4b1328d37001a3676dc6c439202bf98c 100644 (file)
@@ -1919,9 +1919,7 @@ CompileExpr::resolve_method_address (TyTy::FnType *fntype, HirId ref,
 
   auto root = receiver->get_root ();
   auto candidates
-    = Resolver::PathProbeType::Probe (root, segment, true /* probe_impls */,
-                                     false /* probe_bounds */,
-                                     true /* ignore_mandatory_trait_items */);
+    = Resolver::PathProbeImplTrait::Probe (root, segment, trait_ref);
   if (candidates.size () == 0)
     {
       // this means we are defaulting back to the trait_item if