aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-01-24 12:31:12 +0000
committerAleksey Kladov <[email protected]>2019-01-24 12:31:12 +0000
commit1754dd9fdd1bf7d3d72aa2bcb25f33fd8885cd7c (patch)
treeb5f6bf5b64ac882d7077c0872659e33e99403d80
parentec7ed054e06cb2e23fd3911932766b32014c8fa1 (diff)
remove DefKind::Function
-rw-r--r--crates/ra_hir/src/ids.rs2
-rw-r--r--crates/ra_hir/src/impl_block.rs8
2 files changed, 4 insertions, 6 deletions
diff --git a/crates/ra_hir/src/ids.rs b/crates/ra_hir/src/ids.rs
index 913341bd5..f00448081 100644
--- a/crates/ra_hir/src/ids.rs
+++ b/crates/ra_hir/src/ids.rs
@@ -209,7 +209,6 @@ pub struct DefLoc {
209 209
210#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] 210#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
211pub(crate) enum DefKind { 211pub(crate) enum DefKind {
212 Function,
213 Struct, 212 Struct,
214 Enum, 213 Enum,
215 EnumVariant, 214 EnumVariant,
@@ -239,7 +238,6 @@ impl DefId {
239 pub fn resolve(self, db: &impl HirDatabase) -> Def { 238 pub fn resolve(self, db: &impl HirDatabase) -> Def {
240 let loc = self.loc(db); 239 let loc = self.loc(db);
241 match loc.kind { 240 match loc.kind {
242 DefKind::Function => unreachable!(),
243 DefKind::Struct => { 241 DefKind::Struct => {
244 let struct_def = Struct::new(self); 242 let struct_def = Struct::new(self);
245 Def::Struct(struct_def) 243 Def::Struct(struct_def)
diff --git a/crates/ra_hir/src/impl_block.rs b/crates/ra_hir/src/impl_block.rs
index 29becd317..274169f93 100644
--- a/crates/ra_hir/src/impl_block.rs
+++ b/crates/ra_hir/src/impl_block.rs
@@ -77,7 +77,9 @@ impl ImplData {
77 .impl_items() 77 .impl_items()
78 .map(|item_node| { 78 .map(|item_node| {
79 let kind = match item_node.kind() { 79 let kind = match item_node.kind() {
80 ast::ImplItemKind::FnDef(..) => DefKind::Function, 80 ast::ImplItemKind::FnDef(it) => {
81 return ImplItem::Method(Function::from_ast(db, module, file_id, it));
82 }
81 ast::ImplItemKind::ConstDef(..) => DefKind::Item, 83 ast::ImplItemKind::ConstDef(..) => DefKind::Item,
82 ast::ImplItemKind::TypeDef(..) => DefKind::Item, 84 ast::ImplItemKind::TypeDef(..) => DefKind::Item,
83 }; 85 };
@@ -93,9 +95,7 @@ impl ImplData {
93 }; 95 };
94 let def_id = def_loc.id(db); 96 let def_id = def_loc.id(db);
95 match item_node.kind() { 97 match item_node.kind() {
96 ast::ImplItemKind::FnDef(it) => { 98 ast::ImplItemKind::FnDef(_) => unreachable!(),
97 ImplItem::Method(Function::from_ast(db, module, file_id, it))
98 }
99 ast::ImplItemKind::ConstDef(..) => ImplItem::Const(def_id), 99 ast::ImplItemKind::ConstDef(..) => ImplItem::Const(def_id),
100 ast::ImplItemKind::TypeDef(..) => ImplItem::Type(def_id), 100 ast::ImplItemKind::TypeDef(..) => ImplItem::Type(def_id),
101 } 101 }