diff options
Diffstat (limited to 'crates/ra_hir/src/impl_block.rs')
-rw-r--r-- | crates/ra_hir/src/impl_block.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/ra_hir/src/impl_block.rs b/crates/ra_hir/src/impl_block.rs index 274169f93..3df0d3a3b 100644 --- a/crates/ra_hir/src/impl_block.rs +++ b/crates/ra_hir/src/impl_block.rs | |||
@@ -9,6 +9,7 @@ use crate::{ | |||
9 | Function, HirFileId, | 9 | Function, HirFileId, |
10 | db::HirDatabase, | 10 | db::HirDatabase, |
11 | type_ref::TypeRef, | 11 | type_ref::TypeRef, |
12 | ids::LocationCtx, | ||
12 | }; | 13 | }; |
13 | 14 | ||
14 | use crate::code_model_api::{Module, ModuleSource}; | 15 | use crate::code_model_api::{Module, ModuleSource}; |
@@ -72,13 +73,14 @@ impl ImplData { | |||
72 | ) -> Self { | 73 | ) -> Self { |
73 | let target_trait = node.target_trait().map(TypeRef::from_ast); | 74 | let target_trait = node.target_trait().map(TypeRef::from_ast); |
74 | let target_type = TypeRef::from_ast_opt(node.target_type()); | 75 | let target_type = TypeRef::from_ast_opt(node.target_type()); |
76 | let ctx = LocationCtx::new(db, module, file_id); | ||
75 | let items = if let Some(item_list) = node.item_list() { | 77 | let items = if let Some(item_list) = node.item_list() { |
76 | item_list | 78 | item_list |
77 | .impl_items() | 79 | .impl_items() |
78 | .map(|item_node| { | 80 | .map(|item_node| { |
79 | let kind = match item_node.kind() { | 81 | let kind = match item_node.kind() { |
80 | ast::ImplItemKind::FnDef(it) => { | 82 | ast::ImplItemKind::FnDef(it) => { |
81 | return ImplItem::Method(Function::from_ast(db, module, file_id, it)); | 83 | return ImplItem::Method(Function { id: ctx.to_def(it) }); |
82 | } | 84 | } |
83 | ast::ImplItemKind::ConstDef(..) => DefKind::Item, | 85 | ast::ImplItemKind::ConstDef(..) => DefKind::Item, |
84 | ast::ImplItemKind::TypeDef(..) => DefKind::Item, | 86 | ast::ImplItemKind::TypeDef(..) => DefKind::Item, |