diff options
Diffstat (limited to 'crates/ra_hir_ty/src/infer')
-rw-r--r-- | crates/ra_hir_ty/src/infer/expr.rs | 4 | ||||
-rw-r--r-- | crates/ra_hir_ty/src/infer/path.rs | 12 |
2 files changed, 8 insertions, 8 deletions
diff --git a/crates/ra_hir_ty/src/infer/expr.rs b/crates/ra_hir_ty/src/infer/expr.rs index 011c6c5c6..8be567917 100644 --- a/crates/ra_hir_ty/src/infer/expr.rs +++ b/crates/ra_hir_ty/src/infer/expr.rs | |||
@@ -8,7 +8,7 @@ use hir_def::{ | |||
8 | expr::{Array, BinaryOp, Expr, ExprId, Literal, Statement, UnaryOp}, | 8 | expr::{Array, BinaryOp, Expr, ExprId, Literal, Statement, UnaryOp}, |
9 | path::{GenericArg, GenericArgs}, | 9 | path::{GenericArg, GenericArgs}, |
10 | resolver::resolver_for_expr, | 10 | resolver::resolver_for_expr, |
11 | AdtId, ContainerId, Lookup, StructFieldId, | 11 | AdtId, AssocContainerId, Lookup, StructFieldId, |
12 | }; | 12 | }; |
13 | use hir_expand::name::{name, Name}; | 13 | use hir_expand::name::{name, Name}; |
14 | use ra_syntax::ast::RangeOp; | 14 | use ra_syntax::ast::RangeOp; |
@@ -676,7 +676,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
676 | // add obligation for trait implementation, if this is a trait method | 676 | // add obligation for trait implementation, if this is a trait method |
677 | match def { | 677 | match def { |
678 | CallableDef::FunctionId(f) => { | 678 | CallableDef::FunctionId(f) => { |
679 | if let ContainerId::TraitId(trait_) = f.lookup(self.db).container { | 679 | if let AssocContainerId::TraitId(trait_) = f.lookup(self.db).container { |
680 | // construct a TraitDef | 680 | // construct a TraitDef |
681 | let substs = | 681 | let substs = |
682 | a_ty.parameters.prefix(generics(self.db, trait_.into()).len()); | 682 | a_ty.parameters.prefix(generics(self.db, trait_.into()).len()); |
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()); |