diff options
author | cynecx <[email protected]> | 2021-03-20 18:28:26 +0000 |
---|---|---|
committer | cynecx <[email protected]> | 2021-03-20 18:28:26 +0000 |
commit | 34bb13e293e757bb7267eb76884caacb4b94b48b (patch) | |
tree | f60bad4d993844e02fc154f2860f17be35b5c737 /crates/hir/src | |
parent | b1b456c64254e82c4edf065c9cc526bf8e734d68 (diff) |
hir_ty: introduce visible_from_module param into method resolution
Diffstat (limited to 'crates/hir/src')
-rw-r--r-- | crates/hir/src/lib.rs | 7 |
1 files changed, 7 insertions, 0 deletions
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 { | |||
1967 | let env = self.ty.environment.clone(); | 1967 | let env = self.ty.environment.clone(); |
1968 | let krate = krate.id; | 1968 | let krate = krate.id; |
1969 | 1969 | ||
1970 | let from_module = match self.as_adt() { | ||
1971 | Some(adt) => Some(adt.module(db).id), | ||
1972 | None => None, | ||
1973 | }; | ||
1974 | |||
1970 | method_resolution::iterate_method_candidates( | 1975 | method_resolution::iterate_method_candidates( |
1971 | &canonical, | 1976 | &canonical, |
1972 | db, | 1977 | db, |
1973 | env, | 1978 | env, |
1974 | krate, | 1979 | krate, |
1975 | traits_in_scope, | 1980 | traits_in_scope, |
1981 | from_module, | ||
1976 | name, | 1982 | name, |
1977 | method_resolution::LookupMode::MethodCall, | 1983 | method_resolution::LookupMode::MethodCall, |
1978 | |ty, it| match it { | 1984 | |ty, it| match it { |
@@ -2004,6 +2010,7 @@ impl Type { | |||
2004 | env, | 2010 | env, |
2005 | krate, | 2011 | krate, |
2006 | traits_in_scope, | 2012 | traits_in_scope, |
2013 | None, | ||
2007 | name, | 2014 | name, |
2008 | method_resolution::LookupMode::Path, | 2015 | method_resolution::LookupMode::Path, |
2009 | |ty, it| callback(ty, it.into()), | 2016 | |ty, it| callback(ty, it.into()), |