Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/method_resolution/probe.rs')
-rw-r--r--crates/hir-ty/src/method_resolution/probe.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/crates/hir-ty/src/method_resolution/probe.rs b/crates/hir-ty/src/method_resolution/probe.rs
index 60344490d5..84edb51023 100644
--- a/crates/hir-ty/src/method_resolution/probe.rs
+++ b/crates/hir-ty/src/method_resolution/probe.rs
@@ -1295,6 +1295,15 @@ impl<'a, 'db, Choice: ProbeChoice<'db>> ProbeContext<'a, 'db, Choice> {
return ControlFlow::Break(by_value_pick);
}
+ if self.mode == Mode::Path {
+ // Don't autoref in path mode.
+ // rustc doesn't do that and it's not a big deal as non-autorefd methods take priority
+ // and if an autorefd one is selected, we'll register the `NonAutorefdT: Trait` obligation
+ // (which will fail) anyway. But it does have an impact when probing for all methods,
+ // which is something we need to stay accurate.
+ return ControlFlow::Continue(());
+ }
+
let autoref_pick = self.pick_autorefd_method(
step,
self_ty,