diff options
author | Aleksey Kladov <[email protected]> | 2019-11-20 14:39:58 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-11-20 14:43:03 +0000 |
commit | 64c21ed19594b323e72605ba8c5dd4c6eee433f6 (patch) | |
tree | 6b48928149607fa6396357af29abfb4eb3d4d791 /crates/ra_hir_def/src/impls.rs | |
parent | b7a36b54431ca5b746af53549a1b6e142570c7f4 (diff) |
Switch type aliases to new sources
Diffstat (limited to 'crates/ra_hir_def/src/impls.rs')
-rw-r--r-- | crates/ra_hir_def/src/impls.rs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/crates/ra_hir_def/src/impls.rs b/crates/ra_hir_def/src/impls.rs index 9be38c5e1..703e4d503 100644 --- a/crates/ra_hir_def/src/impls.rs +++ b/crates/ra_hir_def/src/impls.rs | |||
@@ -10,7 +10,7 @@ use ra_syntax::ast; | |||
10 | 10 | ||
11 | use crate::{ | 11 | use crate::{ |
12 | db::DefDatabase2, type_ref::TypeRef, AssocItemId, AstItemDef, ConstId, FunctionContainerId, | 12 | db::DefDatabase2, type_ref::TypeRef, AssocItemId, AstItemDef, ConstId, FunctionContainerId, |
13 | FunctionLoc, ImplId, Intern, LocationCtx, TypeAliasId, | 13 | FunctionLoc, ImplId, Intern, LocationCtx, TypeAliasContainerId, TypeAliasLoc, |
14 | }; | 14 | }; |
15 | 15 | ||
16 | #[derive(Debug, Clone, PartialEq, Eq)] | 16 | #[derive(Debug, Clone, PartialEq, Eq)] |
@@ -36,18 +36,23 @@ impl ImplData { | |||
36 | .impl_items() | 36 | .impl_items() |
37 | .map(|item_node| match item_node { | 37 | .map(|item_node| match item_node { |
38 | ast::ImplItem::FnDef(it) => { | 38 | ast::ImplItem::FnDef(it) => { |
39 | let func_id = FunctionLoc { | 39 | let def = FunctionLoc { |
40 | container: FunctionContainerId::ImplId(id), | 40 | container: FunctionContainerId::ImplId(id), |
41 | ast_id: AstId::new(src.file_id, items.ast_id(&it)), | 41 | ast_id: AstId::new(src.file_id, items.ast_id(&it)), |
42 | } | 42 | } |
43 | .intern(db); | 43 | .intern(db); |
44 | func_id.into() | 44 | def.into() |
45 | } | 45 | } |
46 | ast::ImplItem::ConstDef(it) => { | 46 | ast::ImplItem::ConstDef(it) => { |
47 | ConstId::from_ast_id(ctx, items.ast_id(&it)).into() | 47 | ConstId::from_ast_id(ctx, items.ast_id(&it)).into() |
48 | } | 48 | } |
49 | ast::ImplItem::TypeAliasDef(it) => { | 49 | ast::ImplItem::TypeAliasDef(it) => { |
50 | TypeAliasId::from_ast_id(ctx, items.ast_id(&it)).into() | 50 | let def = TypeAliasLoc { |
51 | container: TypeAliasContainerId::ImplId(id), | ||
52 | ast_id: AstId::new(src.file_id, items.ast_id(&it)), | ||
53 | } | ||
54 | .intern(db); | ||
55 | def.into() | ||
51 | } | 56 | } |
52 | }) | 57 | }) |
53 | .collect() | 58 | .collect() |