From f2048019718409885ac57c480f010bdfbfe5bfd0 Mon Sep 17 00:00:00 2001 From: codedump Date: Wed, 16 Jul 2025 23:21:47 +0800 Subject: fix: fix issue 143740, Wrong messages from compiler confusing methods with the same name from different traits --- compiler/rustc_hir_typeck/src/method/probe.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'compiler') diff --git a/compiler/rustc_hir_typeck/src/method/probe.rs b/compiler/rustc_hir_typeck/src/method/probe.rs index 94c93e73627..d5ac17bd785 100644 --- a/compiler/rustc_hir_typeck/src/method/probe.rs +++ b/compiler/rustc_hir_typeck/src/method/probe.rs @@ -1649,7 +1649,8 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> { } } - let sources = candidates.iter().map(|p| self.candidate_source(p, self_ty)).collect(); + let sources = + applicable_candidates.iter().map(|p| self.candidate_source(p.0, self_ty)).collect(); return Some(Err(MethodError::Ambiguity(sources))); } -- cgit 1.4.1-3-g733a5