From 3cd4112bdc924c132cb0eab9d064511a215421ec Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 18:02:20 +0200 Subject: Finalize const&static grammar --- crates/ra_hir_def/src/item_tree/lower.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'crates/ra_hir_def/src/item_tree/lower.rs') 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 { | ast::Item::Enum(_) | ast::Item::Fn(_) | ast::Item::TypeAlias(_) - | ast::Item::ConstDef(_) - | ast::Item::StaticDef(_) + | ast::Item::Const(_) + | ast::Item::Static(_) | ast::Item::MacroCall(_) => { // Skip this if we're already collecting inner items. We'll descend into all nodes // already. @@ -108,8 +108,8 @@ impl Ctx { ast::Item::Enum(ast) => self.lower_enum(ast).map(Into::into), ast::Item::Fn(ast) => self.lower_function(ast).map(Into::into), ast::Item::TypeAlias(ast) => self.lower_type_alias(ast).map(Into::into), - ast::Item::StaticDef(ast) => self.lower_static(ast).map(Into::into), - ast::Item::ConstDef(ast) => Some(self.lower_const(ast).into()), + ast::Item::Static(ast) => self.lower_static(ast).map(Into::into), + ast::Item::Const(ast) => Some(self.lower_const(ast).into()), ast::Item::Module(ast) => self.lower_module(ast).map(Into::into), ast::Item::TraitDef(ast) => self.lower_trait(ast).map(Into::into), ast::Item::ImplDef(ast) => self.lower_impl(ast).map(Into::into), @@ -160,7 +160,7 @@ impl Ctx { match item { ast::AssocItem::Fn(ast) => self.lower_function(ast).map(Into::into), ast::AssocItem::TypeAlias(ast) => self.lower_type_alias(ast).map(Into::into), - ast::AssocItem::ConstDef(ast) => Some(self.lower_const(ast).into()), + ast::AssocItem::Const(ast) => Some(self.lower_const(ast).into()), ast::AssocItem::MacroCall(ast) => self.lower_macro_call(ast).map(Into::into), } } @@ -368,7 +368,7 @@ impl Ctx { Some(id(self.data().type_aliases.alloc(res))) } - fn lower_static(&mut self, static_: &ast::StaticDef) -> Option> { + fn lower_static(&mut self, static_: &ast::Static) -> Option> { let name = static_.name()?.as_name(); let type_ref = self.lower_type_ref_opt(static_.ascribed_type()); let visibility = self.lower_visibility(static_); @@ -378,7 +378,7 @@ impl Ctx { Some(id(self.data().statics.alloc(res))) } - fn lower_const(&mut self, konst: &ast::ConstDef) -> FileItemTreeId { + fn lower_const(&mut self, konst: &ast::Const) -> FileItemTreeId { let name = konst.name().map(|it| it.as_name()); let type_ref = self.lower_type_ref_opt(konst.ascribed_type()); let visibility = self.lower_visibility(konst); @@ -553,7 +553,7 @@ impl Ctx { self.data().functions[func.index].is_unsafe = true; func.into() } - ast::ExternItem::StaticDef(ast) => { + ast::ExternItem::Static(ast) => { let statik = self.lower_static(&ast)?; statik.into() } -- cgit v1.2.3