diff options
Diffstat (limited to 'crates/hir')
-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()), |