diff options
Diffstat (limited to 'crates/ra_hir_ty/src/infer/path.rs')
-rw-r--r-- | crates/ra_hir_ty/src/infer/path.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/ra_hir_ty/src/infer/path.rs b/crates/ra_hir_ty/src/infer/path.rs index 3bae0ca6c..ffd358367 100644 --- a/crates/ra_hir_ty/src/infer/path.rs +++ b/crates/ra_hir_ty/src/infer/path.rs | |||
@@ -3,9 +3,9 @@ | |||
3 | use std::iter; | 3 | use std::iter; |
4 | 4 | ||
5 | use hir_def::{ | 5 | use hir_def::{ |
6 | path::{Path, PathKind, PathSegment}, | 6 | path::{Path, PathSegment}, |
7 | resolver::{ResolveValueResult, Resolver, TypeNs, ValueNs}, | 7 | resolver::{ResolveValueResult, Resolver, TypeNs, ValueNs}, |
8 | AssocItemId, ContainerId, Lookup, | 8 | AssocContainerId, AssocItemId, Lookup, |
9 | }; | 9 | }; |
10 | use hir_expand::name::Name; | 10 | use hir_expand::name::Name; |
11 | 11 | ||
@@ -32,7 +32,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
32 | path: &Path, | 32 | path: &Path, |
33 | id: ExprOrPatId, | 33 | id: ExprOrPatId, |
34 | ) -> Option<Ty> { | 34 | ) -> Option<Ty> { |
35 | let (value, self_subst) = if let PathKind::Type(type_ref) = path.kind() { | 35 | let (value, self_subst) = if let Some(type_ref) = path.type_anchor() { |
36 | if path.segments().is_empty() { | 36 | if path.segments().is_empty() { |
37 | // This can't actually happen syntax-wise | 37 | // This can't actually happen syntax-wise |
38 | return None; | 38 | return None; |
@@ -209,7 +209,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
209 | AssocItemId::TypeAliasId(_) => unreachable!(), | 209 | AssocItemId::TypeAliasId(_) => unreachable!(), |
210 | }; | 210 | }; |
211 | let substs = match container { | 211 | let substs = match container { |
212 | ContainerId::ImplId(impl_id) => { | 212 | AssocContainerId::ImplId(impl_id) => { |
213 | let impl_substs = Substs::build_for_def(self.db, impl_id) | 213 | let impl_substs = Substs::build_for_def(self.db, impl_id) |
214 | .fill(iter::repeat_with(|| self.table.new_type_var())) | 214 | .fill(iter::repeat_with(|| self.table.new_type_var())) |
215 | .build(); | 215 | .build(); |
@@ -221,7 +221,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
221 | self.unify(&impl_self_ty, &ty); | 221 | self.unify(&impl_self_ty, &ty); |
222 | Some(substs) | 222 | Some(substs) |
223 | } | 223 | } |
224 | ContainerId::TraitId(trait_) => { | 224 | AssocContainerId::TraitId(trait_) => { |
225 | // we're picking this method | 225 | // we're picking this method |
226 | let trait_substs = Substs::build_for_def(self.db, trait_) | 226 | let trait_substs = Substs::build_for_def(self.db, trait_) |
227 | .push(ty.clone()) | 227 | .push(ty.clone()) |
@@ -237,7 +237,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
237 | })); | 237 | })); |
238 | Some(substs) | 238 | Some(substs) |
239 | } | 239 | } |
240 | ContainerId::ModuleId(_) => None, | 240 | AssocContainerId::ContainerId(_) => None, |
241 | }; | 241 | }; |
242 | 242 | ||
243 | self.write_assoc_resolution(id, item.into()); | 243 | self.write_assoc_resolution(id, item.into()); |