about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorMatthias Krüger <476013+matthiaskrgr@users.noreply.github.com>2025-07-18 14:49:21 +0200
committerGitHub <noreply@github.com>2025-07-18 14:49:21 +0200
commit5368845df342d77332a8a49d19d45a361f6e9153 (patch)
tree527d8a1d79c978040c1360dd6cc24a080a274b9a /compiler
parentd3bc06ecb499a2e7b08ec8024215205f2ae5becf (diff)
parentf2048019718409885ac57c480f010bdfbfe5bfd0 (diff)
downloadrust-5368845df342d77332a8a49d19d45a361f6e9153.tar.gz
rust-5368845df342d77332a8a49d19d45a361f6e9153.zip
Rollup merge of #144029 - lichuang:fix_issue_143740, r=compiler-errors
Fix wrong messages from methods with the same name from different traits

fix issue https://github.com/rust-lang/rust/issues/143740
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_hir_typeck/src/method/probe.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_hir_typeck/src/method/probe.rs b/compiler/rustc_hir_typeck/src/method/probe.rs
index 3261327a9fd..1f3969bd93c 100644
--- a/compiler/rustc_hir_typeck/src/method/probe.rs
+++ b/compiler/rustc_hir_typeck/src/method/probe.rs
@@ -1650,7 +1650,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)));
         }