From 34bb13e293e757bb7267eb76884caacb4b94b48b Mon Sep 17 00:00:00 2001 From: cynecx Date: Sat, 20 Mar 2021 19:28:26 +0100 Subject: hir_ty: introduce visible_from_module param into method resolution --- crates/hir/src/lib.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'crates/hir') diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs index 30e577671..1a65a5cad 100644 --- a/crates/hir/src/lib.rs +++ b/crates/hir/src/lib.rs @@ -1967,12 +1967,18 @@ impl Type { let env = self.ty.environment.clone(); let krate = krate.id; + let from_module = match self.as_adt() { + Some(adt) => Some(adt.module(db).id), + None => None, + }; + method_resolution::iterate_method_candidates( &canonical, db, env, krate, traits_in_scope, + from_module, name, method_resolution::LookupMode::MethodCall, |ty, it| match it { @@ -2004,6 +2010,7 @@ impl Type { env, krate, traits_in_scope, + None, name, method_resolution::LookupMode::Path, |ty, it| callback(ty, it.into()), -- cgit v1.2.3