diff options
Diffstat (limited to 'crates/ra_hir_def/src/item_tree/lower.rs')
-rw-r--r-- | crates/ra_hir_def/src/item_tree/lower.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/crates/ra_hir_def/src/item_tree/lower.rs b/crates/ra_hir_def/src/item_tree/lower.rs index 6d963c852..a94548e5d 100644 --- a/crates/ra_hir_def/src/item_tree/lower.rs +++ b/crates/ra_hir_def/src/item_tree/lower.rs | |||
@@ -83,8 +83,8 @@ impl Ctx { | |||
83 | | ast::Item::Enum(_) | 83 | | ast::Item::Enum(_) |
84 | | ast::Item::Fn(_) | 84 | | ast::Item::Fn(_) |
85 | | ast::Item::TypeAlias(_) | 85 | | ast::Item::TypeAlias(_) |
86 | | ast::Item::ConstDef(_) | 86 | | ast::Item::Const(_) |
87 | | ast::Item::StaticDef(_) | 87 | | ast::Item::Static(_) |
88 | | ast::Item::MacroCall(_) => { | 88 | | ast::Item::MacroCall(_) => { |
89 | // Skip this if we're already collecting inner items. We'll descend into all nodes | 89 | // Skip this if we're already collecting inner items. We'll descend into all nodes |
90 | // already. | 90 | // already. |
@@ -108,8 +108,8 @@ impl Ctx { | |||
108 | ast::Item::Enum(ast) => self.lower_enum(ast).map(Into::into), | 108 | ast::Item::Enum(ast) => self.lower_enum(ast).map(Into::into), |
109 | ast::Item::Fn(ast) => self.lower_function(ast).map(Into::into), | 109 | ast::Item::Fn(ast) => self.lower_function(ast).map(Into::into), |
110 | ast::Item::TypeAlias(ast) => self.lower_type_alias(ast).map(Into::into), | 110 | ast::Item::TypeAlias(ast) => self.lower_type_alias(ast).map(Into::into), |
111 | ast::Item::StaticDef(ast) => self.lower_static(ast).map(Into::into), | 111 | ast::Item::Static(ast) => self.lower_static(ast).map(Into::into), |
112 | ast::Item::ConstDef(ast) => Some(self.lower_const(ast).into()), | 112 | ast::Item::Const(ast) => Some(self.lower_const(ast).into()), |
113 | ast::Item::Module(ast) => self.lower_module(ast).map(Into::into), | 113 | ast::Item::Module(ast) => self.lower_module(ast).map(Into::into), |
114 | ast::Item::TraitDef(ast) => self.lower_trait(ast).map(Into::into), | 114 | ast::Item::TraitDef(ast) => self.lower_trait(ast).map(Into::into), |
115 | ast::Item::ImplDef(ast) => self.lower_impl(ast).map(Into::into), | 115 | ast::Item::ImplDef(ast) => self.lower_impl(ast).map(Into::into), |
@@ -160,7 +160,7 @@ impl Ctx { | |||
160 | match item { | 160 | match item { |
161 | ast::AssocItem::Fn(ast) => self.lower_function(ast).map(Into::into), | 161 | ast::AssocItem::Fn(ast) => self.lower_function(ast).map(Into::into), |
162 | ast::AssocItem::TypeAlias(ast) => self.lower_type_alias(ast).map(Into::into), | 162 | ast::AssocItem::TypeAlias(ast) => self.lower_type_alias(ast).map(Into::into), |
163 | ast::AssocItem::ConstDef(ast) => Some(self.lower_const(ast).into()), | 163 | ast::AssocItem::Const(ast) => Some(self.lower_const(ast).into()), |
164 | ast::AssocItem::MacroCall(ast) => self.lower_macro_call(ast).map(Into::into), | 164 | ast::AssocItem::MacroCall(ast) => self.lower_macro_call(ast).map(Into::into), |
165 | } | 165 | } |
166 | } | 166 | } |
@@ -368,7 +368,7 @@ impl Ctx { | |||
368 | Some(id(self.data().type_aliases.alloc(res))) | 368 | Some(id(self.data().type_aliases.alloc(res))) |
369 | } | 369 | } |
370 | 370 | ||
371 | fn lower_static(&mut self, static_: &ast::StaticDef) -> Option<FileItemTreeId<Static>> { | 371 | fn lower_static(&mut self, static_: &ast::Static) -> Option<FileItemTreeId<Static>> { |
372 | let name = static_.name()?.as_name(); | 372 | let name = static_.name()?.as_name(); |
373 | let type_ref = self.lower_type_ref_opt(static_.ascribed_type()); | 373 | let type_ref = self.lower_type_ref_opt(static_.ascribed_type()); |
374 | let visibility = self.lower_visibility(static_); | 374 | let visibility = self.lower_visibility(static_); |
@@ -378,7 +378,7 @@ impl Ctx { | |||
378 | Some(id(self.data().statics.alloc(res))) | 378 | Some(id(self.data().statics.alloc(res))) |
379 | } | 379 | } |
380 | 380 | ||
381 | fn lower_const(&mut self, konst: &ast::ConstDef) -> FileItemTreeId<Const> { | 381 | fn lower_const(&mut self, konst: &ast::Const) -> FileItemTreeId<Const> { |
382 | let name = konst.name().map(|it| it.as_name()); | 382 | let name = konst.name().map(|it| it.as_name()); |
383 | let type_ref = self.lower_type_ref_opt(konst.ascribed_type()); | 383 | let type_ref = self.lower_type_ref_opt(konst.ascribed_type()); |
384 | let visibility = self.lower_visibility(konst); | 384 | let visibility = self.lower_visibility(konst); |
@@ -553,7 +553,7 @@ impl Ctx { | |||
553 | self.data().functions[func.index].is_unsafe = true; | 553 | self.data().functions[func.index].is_unsafe = true; |
554 | func.into() | 554 | func.into() |
555 | } | 555 | } |
556 | ast::ExternItem::StaticDef(ast) => { | 556 | ast::ExternItem::Static(ast) => { |
557 | let statik = self.lower_static(&ast)?; | 557 | let statik = self.lower_static(&ast)?; |
558 | statik.into() | 558 | statik.into() |
559 | } | 559 | } |