diff options
Diffstat (limited to 'crates/ra_hir/src/impl_block.rs')
-rw-r--r-- | crates/ra_hir/src/impl_block.rs | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/crates/ra_hir/src/impl_block.rs b/crates/ra_hir/src/impl_block.rs index 7ecf8c368..2f3c916fd 100644 --- a/crates/ra_hir/src/impl_block.rs +++ b/crates/ra_hir/src/impl_block.rs | |||
@@ -7,7 +7,7 @@ use ra_syntax::{ | |||
7 | ast::{self, AstNode}}; | 7 | ast::{self, AstNode}}; |
8 | 8 | ||
9 | use crate::{ | 9 | use crate::{ |
10 | Const, Type, Function, HirFileId, | 10 | Const, TypeAlias, Function, HirFileId, |
11 | HirDatabase, PersistentHirDatabase, | 11 | HirDatabase, PersistentHirDatabase, |
12 | ModuleDef, Trait, Resolution, | 12 | ModuleDef, Trait, Resolution, |
13 | type_ref::TypeRef, | 13 | type_ref::TypeRef, |
@@ -135,13 +135,9 @@ impl ImplData { | |||
135 | item_list | 135 | item_list |
136 | .impl_items() | 136 | .impl_items() |
137 | .map(|item_node| match item_node.kind() { | 137 | .map(|item_node| match item_node.kind() { |
138 | ast::ImplItemKind::FnDef(it) => { | 138 | ast::ImplItemKind::FnDef(it) => Function { id: ctx.to_def(it) }.into(), |
139 | ImplItem::Method(Function { id: ctx.to_def(it) }) | 139 | ast::ImplItemKind::ConstDef(it) => Const { id: ctx.to_def(it) }.into(), |
140 | } | 140 | ast::ImplItemKind::TypeDef(it) => TypeAlias { id: ctx.to_def(it) }.into(), |
141 | ast::ImplItemKind::ConstDef(it) => { | ||
142 | ImplItem::Const(Const { id: ctx.to_def(it) }) | ||
143 | } | ||
144 | ast::ImplItemKind::TypeDef(it) => ImplItem::Type(Type { id: ctx.to_def(it) }), | ||
145 | }) | 141 | }) |
146 | .collect() | 142 | .collect() |
147 | } else { | 143 | } else { |
@@ -168,10 +164,10 @@ impl ImplData { | |||
168 | pub enum ImplItem { | 164 | pub enum ImplItem { |
169 | Method(Function), | 165 | Method(Function), |
170 | Const(Const), | 166 | Const(Const), |
171 | Type(Type), | 167 | TypeAlias(TypeAlias), |
172 | // Existential | 168 | // Existential |
173 | } | 169 | } |
174 | impl_froms!(ImplItem: Const, Type); | 170 | impl_froms!(ImplItem: Const, TypeAlias); |
175 | 171 | ||
176 | impl From<Function> for ImplItem { | 172 | impl From<Function> for ImplItem { |
177 | fn from(func: Function) -> ImplItem { | 173 | fn from(func: Function) -> ImplItem { |