From b9fc7b51a46192a30f445bbca7b1dd857fa0c856 Mon Sep 17 00:00:00 2001 From: Philip Herron Date: Tue, 4 Apr 2023 15:24:01 +0100 Subject: gccrs: cleanup resolve method address 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 --- gcc/rust/backend/rust-compile-expr.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'gcc') diff --git a/gcc/rust/backend/rust-compile-expr.cc b/gcc/rust/backend/rust-compile-expr.cc index 904c47b..90f1b14 100644 --- a/gcc/rust/backend/rust-compile-expr.cc +++ b/gcc/rust/backend/rust-compile-expr.cc @@ -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 -- cgit v1.1