diff options
Diffstat (limited to 'crates/ra_hir_ty/src/infer/path.rs')
-rw-r--r-- | crates/ra_hir_ty/src/infer/path.rs | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/crates/ra_hir_ty/src/infer/path.rs b/crates/ra_hir_ty/src/infer/path.rs index c733b9e1d..318652c61 100644 --- a/crates/ra_hir_ty/src/infer/path.rs +++ b/crates/ra_hir_ty/src/infer/path.rs | |||
@@ -9,11 +9,11 @@ use hir_def::{ | |||
9 | }; | 9 | }; |
10 | use hir_expand::name::Name; | 10 | use hir_expand::name::Name; |
11 | 11 | ||
12 | use crate::{db::HirDatabase, method_resolution, Substs, Ty, ValueTyDefId}; | 12 | use crate::{method_resolution, Substs, Ty, ValueTyDefId}; |
13 | 13 | ||
14 | use super::{ExprOrPatId, InferenceContext, TraitRef}; | 14 | use super::{ExprOrPatId, InferenceContext, TraitRef}; |
15 | 15 | ||
16 | impl<'a, D: HirDatabase> InferenceContext<'a, D> { | 16 | impl<'a> InferenceContext<'a> { |
17 | pub(super) fn infer_path( | 17 | pub(super) fn infer_path( |
18 | &mut self, | 18 | &mut self, |
19 | resolver: &Resolver, | 19 | resolver: &Resolver, |
@@ -47,7 +47,8 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
47 | id, | 47 | id, |
48 | )? | 48 | )? |
49 | } else { | 49 | } else { |
50 | let value_or_partial = resolver.resolve_path_in_value_ns(self.db, path.mod_path())?; | 50 | let value_or_partial = |
51 | resolver.resolve_path_in_value_ns(self.db.upcast(), path.mod_path())?; | ||
51 | 52 | ||
52 | match value_or_partial { | 53 | match value_or_partial { |
53 | ResolveValueResult::ValueNs(it) => (it, None), | 54 | ResolveValueResult::ValueNs(it) => (it, None), |
@@ -192,7 +193,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
192 | 193 | ||
193 | let canonical_ty = self.canonicalizer().canonicalize_ty(ty.clone()); | 194 | let canonical_ty = self.canonicalizer().canonicalize_ty(ty.clone()); |
194 | let krate = self.resolver.krate()?; | 195 | let krate = self.resolver.krate()?; |
195 | let traits_in_scope = self.resolver.traits_in_scope(self.db); | 196 | let traits_in_scope = self.resolver.traits_in_scope(self.db.upcast()); |
196 | 197 | ||
197 | method_resolution::iterate_method_candidates( | 198 | method_resolution::iterate_method_candidates( |
198 | &canonical_ty.value, | 199 | &canonical_ty.value, |
@@ -205,9 +206,11 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
205 | move |_ty, item| { | 206 | move |_ty, item| { |
206 | let (def, container) = match item { | 207 | let (def, container) = match item { |
207 | AssocItemId::FunctionId(f) => { | 208 | AssocItemId::FunctionId(f) => { |
208 | (ValueNs::FunctionId(f), f.lookup(self.db).container) | 209 | (ValueNs::FunctionId(f), f.lookup(self.db.upcast()).container) |
210 | } | ||
211 | AssocItemId::ConstId(c) => { | ||
212 | (ValueNs::ConstId(c), c.lookup(self.db.upcast()).container) | ||
209 | } | 213 | } |
210 | AssocItemId::ConstId(c) => (ValueNs::ConstId(c), c.lookup(self.db).container), | ||
211 | AssocItemId::TypeAliasId(_) => unreachable!(), | 214 | AssocItemId::TypeAliasId(_) => unreachable!(), |
212 | }; | 215 | }; |
213 | let substs = match container { | 216 | let substs = match container { |