diff options
Diffstat (limited to 'crates/ra_hir_ty/src/infer/path.rs')
-rw-r--r-- | crates/ra_hir_ty/src/infer/path.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/crates/ra_hir_ty/src/infer/path.rs b/crates/ra_hir_ty/src/infer/path.rs index ffd358367..2c1d4831d 100644 --- a/crates/ra_hir_ty/src/infer/path.rs +++ b/crates/ra_hir_ty/src/infer/path.rs | |||
@@ -11,7 +11,7 @@ use hir_expand::name::Name; | |||
11 | 11 | ||
12 | use crate::{db::HirDatabase, method_resolution, Substs, Ty, TypeWalk, ValueTyDefId}; | 12 | use crate::{db::HirDatabase, method_resolution, Substs, Ty, TypeWalk, ValueTyDefId}; |
13 | 13 | ||
14 | use super::{ExprOrPatId, InferenceContext, TraitRef}; | 14 | use super::{ExprOrPatId, InferenceContext, TraitEnvironment, TraitRef}; |
15 | 15 | ||
16 | impl<'a, D: HirDatabase> InferenceContext<'a, D> { | 16 | impl<'a, D: HirDatabase> InferenceContext<'a, D> { |
17 | pub(super) fn infer_path( | 17 | pub(super) fn infer_path( |
@@ -193,11 +193,16 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
193 | } | 193 | } |
194 | 194 | ||
195 | let canonical_ty = self.canonicalizer().canonicalize_ty(ty.clone()); | 195 | let canonical_ty = self.canonicalizer().canonicalize_ty(ty.clone()); |
196 | let env = TraitEnvironment::lower(self.db, &self.resolver); | ||
197 | let krate = self.resolver.krate()?; | ||
198 | let traits_in_scope = self.resolver.traits_in_scope(self.db); | ||
196 | 199 | ||
197 | method_resolution::iterate_method_candidates( | 200 | method_resolution::iterate_method_candidates( |
198 | &canonical_ty.value, | 201 | &canonical_ty.value, |
199 | self.db, | 202 | self.db, |
200 | &self.resolver.clone(), | 203 | env, |
204 | krate, | ||
205 | &traits_in_scope, | ||
201 | Some(name), | 206 | Some(name), |
202 | method_resolution::LookupMode::Path, | 207 | method_resolution::LookupMode::Path, |
203 | move |_ty, item| { | 208 | move |_ty, item| { |