diff options
-rw-r--r-- | crates/ra_hir_def/src/body/lower.rs | 4 | ||||
-rw-r--r-- | crates/ra_hir_def/src/data.rs | 12 | ||||
-rw-r--r-- | crates/ra_hir_def/src/lib.rs | 18 | ||||
-rw-r--r-- | crates/ra_hir_def/src/nameres/collector.rs | 8 | ||||
-rw-r--r-- | crates/ra_hir_def/src/resolver.rs | 16 | ||||
-rw-r--r-- | crates/ra_hir_ty/src/infer/expr.rs | 4 | ||||
-rw-r--r-- | crates/ra_hir_ty/src/infer/path.rs | 8 | ||||
-rw-r--r-- | crates/ra_hir_ty/src/lib.rs | 8 | ||||
-rw-r--r-- | crates/ra_hir_ty/src/method_resolution.rs | 10 | ||||
-rw-r--r-- | crates/ra_hir_ty/src/traits/chalk.rs | 6 | ||||
-rw-r--r-- | crates/ra_hir_ty/src/utils.rs | 8 |
11 files changed, 51 insertions, 51 deletions
diff --git a/crates/ra_hir_def/src/body/lower.rs b/crates/ra_hir_def/src/body/lower.rs index 17efa10e2..afd5231cc 100644 --- a/crates/ra_hir_def/src/body/lower.rs +++ b/crates/ra_hir_def/src/body/lower.rs | |||
@@ -25,7 +25,7 @@ use crate::{ | |||
25 | path::GenericArgs, | 25 | path::GenericArgs, |
26 | path::Path, | 26 | path::Path, |
27 | type_ref::{Mutability, TypeRef}, | 27 | type_ref::{Mutability, TypeRef}, |
28 | ContainerId, DefWithBodyId, FunctionLoc, Intern, | 28 | AssocContainerId, DefWithBodyId, FunctionLoc, Intern, |
29 | }; | 29 | }; |
30 | 30 | ||
31 | pub(super) fn lower( | 31 | pub(super) fn lower( |
@@ -490,7 +490,7 @@ where | |||
490 | } | 490 | } |
491 | 491 | ||
492 | fn collect_block_items(&mut self, block: &ast::Block) { | 492 | fn collect_block_items(&mut self, block: &ast::Block) { |
493 | let container = ContainerId::DefWithBodyId(self.def); | 493 | let container = AssocContainerId::DefWithBodyId(self.def); |
494 | for item in block.items() { | 494 | for item in block.items() { |
495 | match item { | 495 | match item { |
496 | ast::ModuleItem::FnDef(def) => { | 496 | ast::ModuleItem::FnDef(def) => { |
diff --git a/crates/ra_hir_def/src/data.rs b/crates/ra_hir_def/src/data.rs index 4f4ef57cc..14e86936b 100644 --- a/crates/ra_hir_def/src/data.rs +++ b/crates/ra_hir_def/src/data.rs | |||
@@ -12,8 +12,8 @@ use crate::{ | |||
12 | db::DefDatabase, | 12 | db::DefDatabase, |
13 | src::HasSource, | 13 | src::HasSource, |
14 | type_ref::{Mutability, TypeRef}, | 14 | type_ref::{Mutability, TypeRef}, |
15 | AssocItemId, ConstId, ConstLoc, ContainerId, FunctionId, FunctionLoc, ImplId, Intern, Lookup, | 15 | AssocContainerId, AssocItemId, ConstId, ConstLoc, FunctionId, FunctionLoc, ImplId, Intern, |
16 | StaticId, TraitId, TypeAliasId, TypeAliasLoc, | 16 | Lookup, StaticId, TraitId, TypeAliasId, TypeAliasLoc, |
17 | }; | 17 | }; |
18 | 18 | ||
19 | #[derive(Debug, Clone, PartialEq, Eq)] | 19 | #[derive(Debug, Clone, PartialEq, Eq)] |
@@ -99,7 +99,7 @@ impl TraitData { | |||
99 | let auto = src.value.is_auto(); | 99 | let auto = src.value.is_auto(); |
100 | let ast_id_map = db.ast_id_map(src.file_id); | 100 | let ast_id_map = db.ast_id_map(src.file_id); |
101 | 101 | ||
102 | let container = ContainerId::TraitId(tr); | 102 | let container = AssocContainerId::TraitId(tr); |
103 | let items = if let Some(item_list) = src.value.item_list() { | 103 | let items = if let Some(item_list) = src.value.item_list() { |
104 | item_list | 104 | item_list |
105 | .impl_items() | 105 | .impl_items() |
@@ -180,7 +180,7 @@ impl ImplData { | |||
180 | .map(|item_node| match item_node { | 180 | .map(|item_node| match item_node { |
181 | ast::ImplItem::FnDef(it) => { | 181 | ast::ImplItem::FnDef(it) => { |
182 | let def = FunctionLoc { | 182 | let def = FunctionLoc { |
183 | container: ContainerId::ImplId(id), | 183 | container: AssocContainerId::ImplId(id), |
184 | ast_id: AstId::new(src.file_id, items.ast_id(&it)), | 184 | ast_id: AstId::new(src.file_id, items.ast_id(&it)), |
185 | } | 185 | } |
186 | .intern(db); | 186 | .intern(db); |
@@ -188,7 +188,7 @@ impl ImplData { | |||
188 | } | 188 | } |
189 | ast::ImplItem::ConstDef(it) => { | 189 | ast::ImplItem::ConstDef(it) => { |
190 | let def = ConstLoc { | 190 | let def = ConstLoc { |
191 | container: ContainerId::ImplId(id), | 191 | container: AssocContainerId::ImplId(id), |
192 | ast_id: AstId::new(src.file_id, items.ast_id(&it)), | 192 | ast_id: AstId::new(src.file_id, items.ast_id(&it)), |
193 | } | 193 | } |
194 | .intern(db); | 194 | .intern(db); |
@@ -196,7 +196,7 @@ impl ImplData { | |||
196 | } | 196 | } |
197 | ast::ImplItem::TypeAliasDef(it) => { | 197 | ast::ImplItem::TypeAliasDef(it) => { |
198 | let def = TypeAliasLoc { | 198 | let def = TypeAliasLoc { |
199 | container: ContainerId::ImplId(id), | 199 | container: AssocContainerId::ImplId(id), |
200 | ast_id: AstId::new(src.file_id, items.ast_id(&it)), | 200 | ast_id: AstId::new(src.file_id, items.ast_id(&it)), |
201 | } | 201 | } |
202 | .intern(db); | 202 | .intern(db); |
diff --git a/crates/ra_hir_def/src/lib.rs b/crates/ra_hir_def/src/lib.rs index 4fc3127c4..3d42762ae 100644 --- a/crates/ra_hir_def/src/lib.rs +++ b/crates/ra_hir_def/src/lib.rs | |||
@@ -71,7 +71,7 @@ impl_intern_key!(FunctionId); | |||
71 | 71 | ||
72 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 72 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
73 | pub struct FunctionLoc { | 73 | pub struct FunctionLoc { |
74 | pub container: ContainerId, | 74 | pub container: AssocContainerId, |
75 | pub ast_id: AstId<ast::FnDef>, | 75 | pub ast_id: AstId<ast::FnDef>, |
76 | } | 76 | } |
77 | 77 | ||
@@ -187,7 +187,7 @@ pub struct ConstId(salsa::InternId); | |||
187 | impl_intern_key!(ConstId); | 187 | impl_intern_key!(ConstId); |
188 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 188 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
189 | pub struct ConstLoc { | 189 | pub struct ConstLoc { |
190 | pub container: ContainerId, | 190 | pub container: AssocContainerId, |
191 | pub ast_id: AstId<ast::ConstDef>, | 191 | pub ast_id: AstId<ast::ConstDef>, |
192 | } | 192 | } |
193 | 193 | ||
@@ -259,7 +259,7 @@ impl_intern_key!(TypeAliasId); | |||
259 | 259 | ||
260 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 260 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
261 | pub struct TypeAliasLoc { | 261 | pub struct TypeAliasLoc { |
262 | pub container: ContainerId, | 262 | pub container: AssocContainerId, |
263 | pub ast_id: AstId<ast::TypeAliasDef>, | 263 | pub ast_id: AstId<ast::TypeAliasDef>, |
264 | } | 264 | } |
265 | 265 | ||
@@ -331,7 +331,7 @@ pub struct LocalTypeParamId(RawId); | |||
331 | impl_arena_id!(LocalTypeParamId); | 331 | impl_arena_id!(LocalTypeParamId); |
332 | 332 | ||
333 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] | 333 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] |
334 | pub enum ContainerId { | 334 | pub enum AssocContainerId { |
335 | ModuleId(ModuleId), | 335 | ModuleId(ModuleId), |
336 | ImplId(ImplId), | 336 | ImplId(ImplId), |
337 | TraitId(TraitId), | 337 | TraitId(TraitId), |
@@ -479,13 +479,13 @@ pub trait HasModule { | |||
479 | fn module(&self, db: &impl db::DefDatabase) -> ModuleId; | 479 | fn module(&self, db: &impl db::DefDatabase) -> ModuleId; |
480 | } | 480 | } |
481 | 481 | ||
482 | impl HasModule for ContainerId { | 482 | impl HasModule for AssocContainerId { |
483 | fn module(&self, db: &impl db::DefDatabase) -> ModuleId { | 483 | fn module(&self, db: &impl db::DefDatabase) -> ModuleId { |
484 | match *self { | 484 | match *self { |
485 | ContainerId::ModuleId(it) => it, | 485 | AssocContainerId::ModuleId(it) => it, |
486 | ContainerId::ImplId(it) => it.lookup(db).container, | 486 | AssocContainerId::ImplId(it) => it.lookup(db).container, |
487 | ContainerId::TraitId(it) => it.lookup(db).container, | 487 | AssocContainerId::TraitId(it) => it.lookup(db).container, |
488 | ContainerId::DefWithBodyId(it) => it.module(db), | 488 | AssocContainerId::DefWithBodyId(it) => it.module(db), |
489 | } | 489 | } |
490 | } | 490 | } |
491 | } | 491 | } |
diff --git a/crates/ra_hir_def/src/nameres/collector.rs b/crates/ra_hir_def/src/nameres/collector.rs index 8bbf7ffa2..848959f7c 100644 --- a/crates/ra_hir_def/src/nameres/collector.rs +++ b/crates/ra_hir_def/src/nameres/collector.rs | |||
@@ -24,7 +24,7 @@ use crate::{ | |||
24 | }, | 24 | }, |
25 | path::{ModPath, PathKind}, | 25 | path::{ModPath, PathKind}, |
26 | per_ns::PerNs, | 26 | per_ns::PerNs, |
27 | AdtId, AstId, ConstLoc, ContainerId, EnumLoc, EnumVariantId, FunctionLoc, ImplLoc, Intern, | 27 | AdtId, AssocContainerId, AstId, ConstLoc, EnumLoc, EnumVariantId, FunctionLoc, ImplLoc, Intern, |
28 | LocalImportId, LocalModuleId, ModuleDefId, ModuleId, StaticLoc, StructLoc, TraitLoc, | 28 | LocalImportId, LocalModuleId, ModuleDefId, ModuleId, StaticLoc, StructLoc, TraitLoc, |
29 | TypeAliasLoc, UnionLoc, | 29 | TypeAliasLoc, UnionLoc, |
30 | }; | 30 | }; |
@@ -763,7 +763,7 @@ where | |||
763 | let def: PerNs = match def.kind { | 763 | let def: PerNs = match def.kind { |
764 | raw::DefKind::Function(ast_id) => { | 764 | raw::DefKind::Function(ast_id) => { |
765 | let def = FunctionLoc { | 765 | let def = FunctionLoc { |
766 | container: ContainerId::ModuleId(module), | 766 | container: AssocContainerId::ModuleId(module), |
767 | ast_id: AstId::new(self.file_id, ast_id), | 767 | ast_id: AstId::new(self.file_id, ast_id), |
768 | } | 768 | } |
769 | .intern(self.def_collector.db); | 769 | .intern(self.def_collector.db); |
@@ -787,7 +787,7 @@ where | |||
787 | } | 787 | } |
788 | raw::DefKind::Const(ast_id) => { | 788 | raw::DefKind::Const(ast_id) => { |
789 | let def = ConstLoc { | 789 | let def = ConstLoc { |
790 | container: ContainerId::ModuleId(module), | 790 | container: AssocContainerId::ModuleId(module), |
791 | ast_id: AstId::new(self.file_id, ast_id), | 791 | ast_id: AstId::new(self.file_id, ast_id), |
792 | } | 792 | } |
793 | .intern(self.def_collector.db); | 793 | .intern(self.def_collector.db); |
@@ -808,7 +808,7 @@ where | |||
808 | } | 808 | } |
809 | raw::DefKind::TypeAlias(ast_id) => { | 809 | raw::DefKind::TypeAlias(ast_id) => { |
810 | let def = TypeAliasLoc { | 810 | let def = TypeAliasLoc { |
811 | container: ContainerId::ModuleId(module), | 811 | container: AssocContainerId::ModuleId(module), |
812 | ast_id: AstId::new(self.file_id, ast_id), | 812 | ast_id: AstId::new(self.file_id, ast_id), |
813 | } | 813 | } |
814 | .intern(self.def_collector.db); | 814 | .intern(self.def_collector.db); |
diff --git a/crates/ra_hir_def/src/resolver.rs b/crates/ra_hir_def/src/resolver.rs index 250329271..d79c9813b 100644 --- a/crates/ra_hir_def/src/resolver.rs +++ b/crates/ra_hir_def/src/resolver.rs | |||
@@ -17,9 +17,9 @@ use crate::{ | |||
17 | nameres::{BuiltinShadowMode, CrateDefMap}, | 17 | nameres::{BuiltinShadowMode, CrateDefMap}, |
18 | path::{ModPath, PathKind}, | 18 | path::{ModPath, PathKind}, |
19 | per_ns::PerNs, | 19 | per_ns::PerNs, |
20 | AdtId, ConstId, ContainerId, DefWithBodyId, EnumId, EnumVariantId, FunctionId, GenericDefId, | 20 | AdtId, AssocContainerId, ConstId, DefWithBodyId, EnumId, EnumVariantId, FunctionId, |
21 | HasModule, ImplId, LocalModuleId, Lookup, ModuleDefId, ModuleId, StaticId, StructId, TraitId, | 21 | GenericDefId, HasModule, ImplId, LocalModuleId, Lookup, ModuleDefId, ModuleId, StaticId, |
22 | TypeAliasId, TypeParamId, VariantId, | 22 | StructId, TraitId, TypeAliasId, TypeParamId, VariantId, |
23 | }; | 23 | }; |
24 | 24 | ||
25 | #[derive(Debug, Clone, Default)] | 25 | #[derive(Debug, Clone, Default)] |
@@ -580,13 +580,13 @@ impl HasResolver for DefWithBodyId { | |||
580 | } | 580 | } |
581 | } | 581 | } |
582 | 582 | ||
583 | impl HasResolver for ContainerId { | 583 | impl HasResolver for AssocContainerId { |
584 | fn resolver(self, db: &impl DefDatabase) -> Resolver { | 584 | fn resolver(self, db: &impl DefDatabase) -> Resolver { |
585 | match self { | 585 | match self { |
586 | ContainerId::TraitId(it) => it.resolver(db), | 586 | AssocContainerId::TraitId(it) => it.resolver(db), |
587 | ContainerId::ImplId(it) => it.resolver(db), | 587 | AssocContainerId::ImplId(it) => it.resolver(db), |
588 | ContainerId::ModuleId(it) => it.resolver(db), | 588 | AssocContainerId::ModuleId(it) => it.resolver(db), |
589 | ContainerId::DefWithBodyId(it) => it.resolver(db), | 589 | AssocContainerId::DefWithBodyId(it) => it.resolver(db), |
590 | } | 590 | } |
591 | } | 591 | } |
592 | } | 592 | } |
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 | }; |
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; |
@@ -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; | |||
5 | use hir_def::{ | 5 | use 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 | }; |
10 | use hir_expand::name::Name; | 10 | use 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()); |
diff --git a/crates/ra_hir_ty/src/lib.rs b/crates/ra_hir_ty/src/lib.rs index 7ca9e6b8a..7310ef10d 100644 --- a/crates/ra_hir_ty/src/lib.rs +++ b/crates/ra_hir_ty/src/lib.rs | |||
@@ -44,8 +44,8 @@ use std::sync::Arc; | |||
44 | use std::{fmt, iter, mem}; | 44 | use std::{fmt, iter, mem}; |
45 | 45 | ||
46 | use hir_def::{ | 46 | use hir_def::{ |
47 | expr::ExprId, type_ref::Mutability, AdtId, ContainerId, DefWithBodyId, GenericDefId, HasModule, | 47 | expr::ExprId, type_ref::Mutability, AdtId, AssocContainerId, DefWithBodyId, GenericDefId, |
48 | Lookup, TraitId, TypeAliasId, | 48 | HasModule, Lookup, TraitId, TypeAliasId, |
49 | }; | 49 | }; |
50 | use hir_expand::name::Name; | 50 | use hir_expand::name::Name; |
51 | use ra_db::{impl_intern_key, salsa, CrateId}; | 51 | use ra_db::{impl_intern_key, salsa, CrateId}; |
@@ -251,7 +251,7 @@ impl ProjectionTy { | |||
251 | 251 | ||
252 | fn trait_(&self, db: &impl HirDatabase) -> TraitId { | 252 | fn trait_(&self, db: &impl HirDatabase) -> TraitId { |
253 | match self.associated_ty.lookup(db).container { | 253 | match self.associated_ty.lookup(db).container { |
254 | ContainerId::TraitId(it) => it, | 254 | AssocContainerId::TraitId(it) => it, |
255 | _ => panic!("projection ty without parent trait"), | 255 | _ => panic!("projection ty without parent trait"), |
256 | } | 256 | } |
257 | } | 257 | } |
@@ -943,7 +943,7 @@ impl HirDisplay for ApplicationTy { | |||
943 | } | 943 | } |
944 | TypeCtor::AssociatedType(type_alias) => { | 944 | TypeCtor::AssociatedType(type_alias) => { |
945 | let trait_ = match type_alias.lookup(f.db).container { | 945 | let trait_ = match type_alias.lookup(f.db).container { |
946 | ContainerId::TraitId(it) => it, | 946 | AssocContainerId::TraitId(it) => it, |
947 | _ => panic!("not an associated type"), | 947 | _ => panic!("not an associated type"), |
948 | }; | 948 | }; |
949 | let trait_name = f.db.trait_data(trait_).name.clone(); | 949 | let trait_name = f.db.trait_data(trait_).name.clone(); |
diff --git a/crates/ra_hir_ty/src/method_resolution.rs b/crates/ra_hir_ty/src/method_resolution.rs index d0b2b016d..1c2e7b934 100644 --- a/crates/ra_hir_ty/src/method_resolution.rs +++ b/crates/ra_hir_ty/src/method_resolution.rs | |||
@@ -6,8 +6,8 @@ use std::sync::Arc; | |||
6 | 6 | ||
7 | use arrayvec::ArrayVec; | 7 | use arrayvec::ArrayVec; |
8 | use hir_def::{ | 8 | use hir_def::{ |
9 | lang_item::LangItemTarget, resolver::Resolver, type_ref::Mutability, AssocItemId, ContainerId, | 9 | lang_item::LangItemTarget, resolver::Resolver, type_ref::Mutability, AssocContainerId, |
10 | FunctionId, HasModule, ImplId, Lookup, TraitId, | 10 | AssocItemId, FunctionId, HasModule, ImplId, Lookup, TraitId, |
11 | }; | 11 | }; |
12 | use hir_expand::name::Name; | 12 | use hir_expand::name::Name; |
13 | use ra_db::CrateId; | 13 | use ra_db::CrateId; |
@@ -451,12 +451,12 @@ fn transform_receiver_ty( | |||
451 | self_ty: &Canonical<Ty>, | 451 | self_ty: &Canonical<Ty>, |
452 | ) -> Option<Ty> { | 452 | ) -> Option<Ty> { |
453 | let substs = match function_id.lookup(db).container { | 453 | let substs = match function_id.lookup(db).container { |
454 | ContainerId::TraitId(_) => Substs::build_for_def(db, function_id) | 454 | AssocContainerId::TraitId(_) => Substs::build_for_def(db, function_id) |
455 | .push(self_ty.value.clone()) | 455 | .push(self_ty.value.clone()) |
456 | .fill_with_unknown() | 456 | .fill_with_unknown() |
457 | .build(), | 457 | .build(), |
458 | ContainerId::ImplId(impl_id) => inherent_impl_substs(db, impl_id, &self_ty)?, | 458 | AssocContainerId::ImplId(impl_id) => inherent_impl_substs(db, impl_id, &self_ty)?, |
459 | ContainerId::ModuleId(_) | ContainerId::DefWithBodyId(_) => unreachable!(), | 459 | AssocContainerId::ModuleId(_) | AssocContainerId::DefWithBodyId(_) => unreachable!(), |
460 | }; | 460 | }; |
461 | let sig = db.callable_item_signature(function_id.into()); | 461 | let sig = db.callable_item_signature(function_id.into()); |
462 | Some(sig.params()[0].clone().subst(&substs)) | 462 | Some(sig.params()[0].clone().subst(&substs)) |
diff --git a/crates/ra_hir_ty/src/traits/chalk.rs b/crates/ra_hir_ty/src/traits/chalk.rs index fc21872b2..6a31014d8 100644 --- a/crates/ra_hir_ty/src/traits/chalk.rs +++ b/crates/ra_hir_ty/src/traits/chalk.rs | |||
@@ -9,7 +9,7 @@ use chalk_ir::{ | |||
9 | }; | 9 | }; |
10 | use chalk_rust_ir::{AssociatedTyDatum, AssociatedTyValue, ImplDatum, StructDatum, TraitDatum}; | 10 | use chalk_rust_ir::{AssociatedTyDatum, AssociatedTyValue, ImplDatum, StructDatum, TraitDatum}; |
11 | 11 | ||
12 | use hir_def::{AssocItemId, ContainerId, GenericDefId, ImplId, Lookup, TraitId, TypeAliasId}; | 12 | use hir_def::{AssocContainerId, AssocItemId, GenericDefId, ImplId, Lookup, TraitId, TypeAliasId}; |
13 | use ra_db::{ | 13 | use ra_db::{ |
14 | salsa::{InternId, InternKey}, | 14 | salsa::{InternId, InternKey}, |
15 | CrateId, | 15 | CrateId, |
@@ -542,7 +542,7 @@ pub(crate) fn associated_ty_data_query( | |||
542 | debug!("associated_ty_data {:?}", id); | 542 | debug!("associated_ty_data {:?}", id); |
543 | let type_alias: TypeAliasId = from_chalk(db, id); | 543 | let type_alias: TypeAliasId = from_chalk(db, id); |
544 | let trait_ = match type_alias.lookup(db).container { | 544 | let trait_ = match type_alias.lookup(db).container { |
545 | ContainerId::TraitId(t) => t, | 545 | AssocContainerId::TraitId(t) => t, |
546 | _ => panic!("associated type not in trait"), | 546 | _ => panic!("associated type not in trait"), |
547 | }; | 547 | }; |
548 | let generic_params = generics(db, type_alias.into()); | 548 | let generic_params = generics(db, type_alias.into()); |
@@ -755,7 +755,7 @@ fn type_alias_associated_ty_value( | |||
755 | ) -> Arc<AssociatedTyValue<ChalkIr>> { | 755 | ) -> Arc<AssociatedTyValue<ChalkIr>> { |
756 | let type_alias_data = db.type_alias_data(type_alias); | 756 | let type_alias_data = db.type_alias_data(type_alias); |
757 | let impl_id = match type_alias.lookup(db).container { | 757 | let impl_id = match type_alias.lookup(db).container { |
758 | ContainerId::ImplId(it) => it, | 758 | AssocContainerId::ImplId(it) => it, |
759 | _ => panic!("assoc ty value should be in impl"), | 759 | _ => panic!("assoc ty value should be in impl"), |
760 | }; | 760 | }; |
761 | 761 | ||
diff --git a/crates/ra_hir_ty/src/utils.rs b/crates/ra_hir_ty/src/utils.rs index 34defc1a2..8b5b611ec 100644 --- a/crates/ra_hir_ty/src/utils.rs +++ b/crates/ra_hir_ty/src/utils.rs | |||
@@ -9,7 +9,7 @@ use hir_def::{ | |||
9 | path::Path, | 9 | path::Path, |
10 | resolver::{HasResolver, TypeNs}, | 10 | resolver::{HasResolver, TypeNs}, |
11 | type_ref::TypeRef, | 11 | type_ref::TypeRef, |
12 | ContainerId, GenericDefId, Lookup, TraitId, TypeAliasId, TypeParamId, VariantId, | 12 | AssocContainerId, GenericDefId, Lookup, TraitId, TypeAliasId, TypeParamId, VariantId, |
13 | }; | 13 | }; |
14 | use hir_expand::name::{name, Name}; | 14 | use hir_expand::name::{name, Name}; |
15 | 15 | ||
@@ -155,8 +155,8 @@ fn parent_generic_def(db: &impl DefDatabase, def: GenericDefId) -> Option<Generi | |||
155 | }; | 155 | }; |
156 | 156 | ||
157 | match container { | 157 | match container { |
158 | ContainerId::ImplId(it) => Some(it.into()), | 158 | AssocContainerId::ImplId(it) => Some(it.into()), |
159 | ContainerId::TraitId(it) => Some(it.into()), | 159 | AssocContainerId::TraitId(it) => Some(it.into()), |
160 | ContainerId::ModuleId(_) | ContainerId::DefWithBodyId(_) => None, | 160 | AssocContainerId::ModuleId(_) | AssocContainerId::DefWithBodyId(_) => None, |
161 | } | 161 | } |
162 | } | 162 | } |