aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty/src/infer
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-12-20 10:59:50 +0000
committerAleksey Kladov <[email protected]>2019-12-20 11:00:05 +0000
commit8fc20b65035d93bcc1b3a89127916bd165a8d938 (patch)
tree7e95963bb359eb6eeda8f6aba564fd3eaf7030d2 /crates/ra_hir_ty/src/infer
parent67c2aea182c375108ebb8b923f5679e4f7fef1df (diff)
Rename ContainerId -> AssocContainerId
Diffstat (limited to 'crates/ra_hir_ty/src/infer')
-rw-r--r--crates/ra_hir_ty/src/infer/expr.rs4
-rw-r--r--crates/ra_hir_ty/src/infer/path.rs8
2 files changed, 6 insertions, 6 deletions
diff --git a/crates/ra_hir_ty/src/infer/expr.rs b/crates/ra_hir_ty/src/infer/expr.rs
index 924ad3e81..6917c183b 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};
13use hir_expand::name::{name, Name}; 13use hir_expand::name::{name, Name};
14use ra_syntax::ast::RangeOp; 14use ra_syntax::ast::RangeOp;
@@ -672,7 +672,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> {
672 // add obligation for trait implementation, if this is a trait method 672 // add obligation for trait implementation, if this is a trait method
673 match def { 673 match def {
674 CallableDef::FunctionId(f) => { 674 CallableDef::FunctionId(f) => {
675 if let ContainerId::TraitId(trait_) = f.lookup(self.db).container { 675 if let AssocContainerId::TraitId(trait_) = f.lookup(self.db).container {
676 // construct a TraitDef 676 // construct a TraitDef
677 let substs = 677 let substs =
678 a_ty.parameters.prefix(generics(self.db, trait_.into()).len()); 678 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 31c90ea1e..a96ab75d1 100644
--- a/crates/ra_hir_ty/src/infer/path.rs
+++ b/crates/ra_hir_ty/src/infer/path.rs
@@ -5,7 +5,7 @@ use std::iter;
5use hir_def::{ 5use hir_def::{
6 path::{Path, 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};
10use hir_expand::name::Name; 10use hir_expand::name::Name;
11 11
@@ -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(_) | ContainerId::DefWithBodyId(_) => None, 240 AssocContainerId::ModuleId(_) | AssocContainerId::DefWithBodyId(_) => None,
241 }; 241 };
242 242
243 self.write_assoc_resolution(id, item.into()); 243 self.write_assoc_resolution(id, item.into());