Repository: rust-analyzer/rust-analyzer
Pull request #5605 (2020-07-30 16:11:42)

fmt


bors r+
🤖


Patch:
diff --git a/crates/ra_assists/src/handlers/add_missing_impl_members.rs b/crates/ra_assists/src/handlers/add_missing_impl_members.rs
index 1e4d4748c2..1ab176c261 100644
--- a/crates/ra_assists/src/handlers/add_missing_impl_members.rs
+++ b/crates/ra_assists/src/handlers/add_missing_impl_members.rs
@@ -120,7 +120,7 @@ fn add_missing_impl_members_inner(
         match item {
             ast::AssocItem::Fn(def) => def.name(),
             ast::AssocItem::TypeAlias(def) => def.name(),
-            ast::AssocItem::ConstDef(def) => def.name(),
+            ast::AssocItem::Const(def) => def.name(),
             ast::AssocItem::MacroCall(_) => None,
         }
         .map(|it| it.text().clone())
@@ -131,7 +131,7 @@ fn add_missing_impl_members_inner(
         .map(|i| match i {
             hir::AssocItem::Function(i) => ast::AssocItem::Fn(i.source(ctx.db()).value),
             hir::AssocItem::TypeAlias(i) => ast::AssocItem::TypeAlias(i.source(ctx.db()).value),
-            hir::AssocItem::Const(i) => ast::AssocItem::ConstDef(i.source(ctx.db()).value),
+            hir::AssocItem::Const(i) => ast::AssocItem::Const(i.source(ctx.db()).value),
         })
         .filter(|t| def_name(&t).is_some())
         .filter(|t| match t {
diff --git a/crates/ra_assists/src/handlers/change_visibility.rs b/crates/ra_assists/src/handlers/change_visibility.rs
index 12c40a3cc5..76144d7d24 100644
--- a/crates/ra_assists/src/handlers/change_visibility.rs
+++ b/crates/ra_assists/src/handlers/change_visibility.rs
@@ -1,7 +1,7 @@
 use ra_syntax::{
     ast::{self, NameOwner, VisibilityOwner},
     AstNode,
-    SyntaxKind::{CONST_DEF, ENUM_DEF, FN, MODULE, STATIC_DEF, STRUCT, TRAIT_DEF, VISIBILITY},
+    SyntaxKind::{CONST, ENUM, FN, MODULE, STATIC, STRUCT, TRAIT_DEF, VISIBILITY},
     T,
 };
 use test_utils::mark;
@@ -36,7 +36,7 @@ fn add_vis(acc: &mut Assists, ctx: &AssistContext) -> Option<()> {
 
     let (offset, target) = if let Some(keyword) = item_keyword {
         let parent = keyword.parent();
-        let def_kws = vec![CONST_DEF, STATIC_DEF, FN, MODULE, STRUCT, ENUM_DEF, TRAIT_DEF];
+        let def_kws = vec![CONST, STATIC, FN, MODULE, STRUCT, ENUM, TRAIT_DEF];
         // Parent is not a definition, can't add visibility
         if !def_kws.iter().any(|&def_kw| def_kw == parent.kind()) {
             return None;
diff --git a/crates/ra_assists/src/handlers/extract_struct_from_enum_variant.rs b/crates/ra_assists/src/handlers/extract_struct_from_enum_variant.rs
index 2b8e273b3e..ccec688cae 100644
--- a/crates/ra_assists/src/handlers/extract_struct_from_enum_variant.rs
+++ b/crates/ra_assists/src/handlers/extract_struct_from_enum_variant.rs
@@ -31,7 +31,7 @@ pub(crate) fn extract_struct_from_enum_variant(
     acc: &mut Assists,
     ctx: &AssistContext,
 ) -> Option<()> {
-    let variant = ctx.find_node_at_offset::<ast::EnumVariant>()?;
+    let variant = ctx.find_node_at_offset::<ast::Variant>()?;
     let field_list = match variant.kind() {
         ast::StructKind::Tuple(field_list) => field_list,
         _ => return None,
diff --git a/crates/ra_assists/src/handlers/generate_from_impl_for_enum.rs b/crates/ra_assists/src/handlers/generate_from_impl_for_enum.rs
index a347e3c2ef..5b282a30ac 100644
--- a/crates/ra_assists/src/handlers/generate_from_impl_for_enum.rs
+++ b/crates/ra_assists/src/handlers/generate_from_impl_for_enum.rs
@@ -22,7 +22,7 @@ use crate::{utils::FamousDefs, AssistContext, AssistId, AssistKind, Assists};
 // }
 // ```
 pub(crate) fn generate_from_impl_for_enum(acc: &mut Assists, ctx: &AssistContext) -> Option<()> {
-    let variant = ctx.find_node_at_offset::<ast::EnumVariant>()?;
+    let variant = ctx.find_node_at_offset::<ast::Variant>()?;
     let variant_name = variant.name()?;
     let enum_name = variant.parent_enum().name()?;
     let field_list = match variant.kind() {
@@ -69,7 +69,7 @@ impl From<{0}> for {1} {{
 
 fn existing_from_impl(
     sema: &'_ hir::Semantics<'_, RootDatabase>,
-    variant: &ast::EnumVariant,
+    variant: &ast::Variant,
 ) -> Option<()> {
     let variant = sema.to_def(variant)?;
     let enum_ = variant.parent_enum(sema.db);
diff --git a/crates/ra_assists/src/handlers/move_bounds.rs b/crates/ra_assists/src/handlers/move_bounds.rs
index 3b82477c50..84ac75fa86 100644
--- a/crates/ra_assists/src/handlers/move_bounds.rs
+++ b/crates/ra_assists/src/handlers/move_bounds.rs
@@ -40,7 +40,7 @@ pub(crate) fn move_bounds_to_where_clause(acc: &mut Assists, ctx: &AssistContext
             ast::Fn(it) => it.body()?.syntax().clone().into(),
             ast::TraitDef(it) => it.assoc_item_list()?.syntax().clone().into(),
             ast::ImplDef(it) => it.assoc_item_list()?.syntax().clone().into(),
-            ast::EnumDef(it) => it.variant_list()?.syntax().clone().into(),
+            ast::Enum(it) => it.variant_list()?.syntax().clone().into(),
             ast::Struct(it) => {
                 it.syntax().children_with_tokens()
                     .find(|it| it.kind() == RECORD_FIELD_LIST || it.kind() == T![;])?
diff --git a/crates/ra_assists/src/utils.rs b/crates/ra_assists/src/utils.rs
index 748be011b5..337e3474f8 100644
--- a/crates/ra_assists/src/utils.rs
+++ b/crates/ra_assists/src/utils.rs
@@ -78,7 +78,7 @@ pub fn get_missing_assoc_items(
                     }
                 }
 
-                ast::AssocItem::ConstDef(c) => {
+                ast::AssocItem::Const(c) => {
                     if let Some(n) = c.name() {
                         impl_fns_consts.insert(n.syntax().to_string());
                     }
diff --git a/crates/ra_hir/src/has_source.rs b/crates/ra_hir/src/has_source.rs
index 811a12e005..9581552e57 100644
--- a/crates/ra_hir/src/has_source.rs
+++ b/crates/ra_hir/src/has_source.rs
@@ -69,14 +69,14 @@ impl HasSource for Union {
     }
 }
 impl HasSource for Enum {
-    type Ast = ast::EnumDef;
-    fn source(self, db: &dyn HirDatabase) -> InFile<ast::EnumDef> {
+    type Ast = ast::Enum;
+    fn source(self, db: &dyn HirDatabase) -> InFile<ast::Enum> {
         self.id.lookup(db.upcast()).source(db.upcast())
     }
 }
 impl HasSource for EnumVariant {
-    type Ast = ast::EnumVariant;
-    fn source(self, db: &dyn HirDatabase) -> InFile<ast::EnumVariant> {
+    type Ast = ast::Variant;
+    fn source(self, db: &dyn HirDatabase) -> InFile<ast::Variant> {
         self.parent.id.child_source(db.upcast()).map(|map| map[self.id].clone())
     }
 }
@@ -87,14 +87,14 @@ impl HasSource for Function {
     }
 }
 impl HasSource for Const {
-    type Ast = ast::ConstDef;
-    fn source(self, db: &dyn HirDatabase) -> InFile<ast::ConstDef> {
+    type Ast = ast::Const;
+    fn source(self, db: &dyn HirDatabase) -> InFile<ast::Const> {
         self.id.lookup(db.upcast()).source(db.upcast())
     }
 }
 impl HasSource for Static {
-    type Ast = ast::StaticDef;
-    fn source(self, db: &dyn HirDatabase) -> InFile<ast::StaticDef> {
+    type Ast = ast::Static;
+    fn source(self, db: &dyn HirDatabase) -> InFile<ast::Static> {
         self.id.lookup(db.upcast()).source(db.upcast())
     }
 }
diff --git a/crates/ra_hir/src/semantics.rs b/crates/ra_hir/src/semantics.rs
index 7df018b059..32a60b7896 100644
--- a/crates/ra_hir/src/semantics.rs
+++ b/crates/ra_hir/src/semantics.rs
@@ -581,17 +581,17 @@ macro_rules! to_def_impls {
 to_def_impls![
     (crate::Module, ast::Module, module_to_def),
     (crate::Struct, ast::Struct, struct_to_def),
-    (crate::Enum, ast::EnumDef, enum_to_def),
+    (crate::Enum, ast::Enum, enum_to_def),
     (crate::Union, ast::Union, union_to_def),
     (crate::Trait, ast::TraitDef, trait_to_def),
     (crate::ImplDef, ast::ImplDef, impl_to_def),
     (crate::TypeAlias, ast::TypeAlias, type_alias_to_def),
-    (crate::Const, ast::ConstDef, const_to_def),
-    (crate::Static, ast::StaticDef, static_to_def),
+    (crate::Const, ast::Const, const_to_def),
+    (crate::Static, ast::Static, static_to_def),
     (crate::Function, ast::Fn, fn_to_def),
     (crate::Field, ast::RecordField, record_field_to_def),
     (crate::Field, ast::TupleField, tuple_field_to_def),
-    (crate::EnumVariant, ast::EnumVariant, enum_variant_to_def),
+    (crate::EnumVariant, ast::Variant, enum_variant_to_def),
     (crate::TypeParam, ast::TypeParam, type_param_to_def),
     (crate::MacroDef, ast::MacroCall, macro_call_to_def), // this one is dubious, not all calls are macros
     (crate::Local, ast::BindPat, bind_pat_to_def),
diff --git a/crates/ra_hir/src/semantics/source_to_def.rs b/crates/ra_hir/src/semantics/source_to_def.rs
index 75b773352f..782a03f9e2 100644
--- a/crates/ra_hir/src/semantics/source_to_def.rs
+++ b/crates/ra_hir/src/semantics/source_to_def.rs
@@ -77,16 +77,16 @@ impl SourceToDefCtx<'_, '_> {
     pub(super) fn struct_to_def(&mut self, src: InFile<ast::Struct>) -> Option<StructId> {
         self.to_def(src, keys::STRUCT)
     }
-    pub(super) fn enum_to_def(&mut self, src: InFile<ast::EnumDef>) -> Option<EnumId> {
+    pub(super) fn enum_to_def(&mut self, src: InFile<ast::Enum>) -> Option<EnumId> {
         self.to_def(src, keys::ENUM)
     }
     pub(super) fn union_to_def(&mut self, src: InFile<ast::Union>) -> Option<UnionId> {
         self.to_def(src, keys::UNION)
     }
-    pub(super) fn static_to_def(&mut self, src: InFile<ast::StaticDef>) -> Option<StaticId> {
+    pub(super) fn static_to_def(&mut self, src: InFile<ast::Static>) -> Option<StaticId> {
         self.to_def(src, keys::STATIC)
     }
-    pub(super) fn const_to_def(&mut self, src: InFile<ast::ConstDef>) -> Option<ConstId> {
+    pub(super) fn const_to_def(&mut self, src: InFile<ast::Const>) -> Option<ConstId> {
         self.to_def(src, keys::CONST)
     }
     pub(super) fn type_alias_to_def(&mut self, src: InFile<ast::TypeAlias>) -> Option<TypeAliasId> {
@@ -100,9 +100,9 @@ impl SourceToDefCtx<'_, '_> {
     }
     pub(super) fn enum_variant_to_def(
         &mut self,
-        src: InFile<ast::EnumVariant>,
+        src: InFile<ast::Variant>,
     ) -> Option<EnumVariantId> {
-        self.to_def(src, keys::ENUM_VARIANT)
+        self.to_def(src, keys::VARIANT)
     }
     pub(super) fn bind_pat_to_def(
         &mut self,
@@ -170,7 +170,7 @@ impl SourceToDefCtx<'_, '_> {
                         let def = self.struct_to_def(container.with_value(it))?;
                         VariantId::from(def).into()
                     },
-                    ast::EnumDef(it) => {
+                    ast::Enum(it) => {
                         let def = self.enum_to_def(container.with_value(it))?;
                         def.into()
                     },
@@ -178,11 +178,11 @@ impl SourceToDefCtx<'_, '_> {
                         let def = self.union_to_def(container.with_value(it))?;
                         VariantId::from(def).into()
                     },
-                    ast::StaticDef(it) => {
+                    ast::Static(it) => {
                         let def = self.static_to_def(container.with_value(it))?;
                         DefWithBodyId::from(def).into()
                     },
-                    ast::ConstDef(it) => {
+                    ast::Const(it) => {
                         let def = self.const_to_def(container.with_value(it))?;
                         DefWithBodyId::from(def).into()
                     },
@@ -206,7 +206,7 @@ impl SourceToDefCtx<'_, '_> {
                 match (container.value) {
                     ast::Fn(it) => self.fn_to_def(container.with_value(it))?.into(),
                     ast::Struct(it) => self.struct_to_def(container.with_value(it))?.into(),
-                    ast::EnumDef(it) => self.enum_to_def(container.with_value(it))?.into(),
+                    ast::Enum(it) => self.enum_to_def(container.with_value(it))?.into(),
                     ast::TraitDef(it) => self.trait_to_def(container.with_value(it))?.into(),
                     ast::TypeAlias(it) => self.type_alias_to_def(container.with_value(it))?.into(),
                     ast::ImplDef(it) => self.impl_to_def(container.with_value(it))?.into(),
@@ -222,8 +222,8 @@ impl SourceToDefCtx<'_, '_> {
         for container in src.cloned().ancestors_with_macros(self.db.upcast()).skip(1) {
             let res: DefWithBodyId = match_ast! {
                 match (container.value) {
-                    ast::ConstDef(it) => self.const_to_def(container.with_value(it))?.into(),
-                    ast::StaticDef(it) => self.static_to_def(container.with_value(it))?.into(),
+                    ast::Const(it) => self.const_to_def(container.with_value(it))?.into(),
+                    ast::Static(it) => self.static_to_def(container.with_value(it))?.into(),
                     ast::Fn(it) => self.fn_to_def(container.with_value(it))?.into(),
                     _ => continue,
                 }
diff --git a/crates/ra_hir_def/src/adt.rs b/crates/ra_hir_def/src/adt.rs
index 2be23c45d3..231c1dfab8 100644
--- a/crates/ra_hir_def/src/adt.rs
+++ b/crates/ra_hir_def/src/adt.rs
@@ -112,7 +112,7 @@ impl EnumData {
 
 impl HasChildSource for EnumId {
     type ChildId = LocalEnumVariantId;
-    type Value = ast::EnumVariant;
+    type Value = ast::Variant;
     fn child_source(&self, db: &dyn DefDatabase) -> InFile<ArenaMap<Self::ChildId, Self::Value>> {
         let src = self.lookup(db).source(db);
         let mut trace = Trace::new_for_map();
@@ -123,8 +123,8 @@ impl HasChildSource for EnumId {
 
 fn lower_enum(
     db: &dyn DefDatabase,
-    trace: &mut Trace<EnumVariantData, ast::EnumVariant>,
-    ast: &InFile<ast::EnumDef>,
+    trace: &mut Trace<EnumVariantData, ast::Variant>,
+    ast: &InFile<ast::Enum>,
     module_id: ModuleId,
 ) {
     let expander = CfgExpander::new(db, ast.file_id, module_id.krate);
diff --git a/crates/ra_hir_def/src/body/lower.rs b/crates/ra_hir_def/src/body/lower.rs
index 840841d875..4a26e6397e 100644
--- a/crates/ra_hir_def/src/body/lower.rs
+++ b/crates/ra_hir_def/src/body/lower.rs
@@ -641,14 +641,14 @@ impl ExprCollector<'_> {
                             def.name(),
                         )
                     }
-                    ast::Item::ConstDef(def) => {
+                    ast::Item::Const(def) => {
                         let id = self.find_inner_item(&def)?;
                         (
                             ConstLoc { container: container.into(), id }.intern(self.db).into(),
                             def.name(),
                         )
                     }
-                    ast::Item::StaticDef(def) => {
+                    ast::Item::Static(def) => {
                         let id = self.find_inner_item(&def)?;
                         (StaticLoc { container, id }.intern(self.db).into(), def.name())
                     }
@@ -656,7 +656,7 @@ impl ExprCollector<'_> {
                         let id = self.find_inner_item(&def)?;
                         (StructLoc { container, id }.intern(self.db).into(), def.name())
                     }
-                    ast::Item::EnumDef(def) => {
+                    ast::Item::Enum(def) => {
                         let id = self.find_inner_item(&def)?;
                         (EnumLoc { container, id }.intern(self.db).into(), def.name())
                     }
diff --git a/crates/ra_hir_def/src/child_by_source.rs b/crates/ra_hir_def/src/child_by_source.rs
index a885ec96d6..dcb00a1d9a 100644
--- a/crates/ra_hir_def/src/child_by_source.rs
+++ b/crates/ra_hir_def/src/child_by_source.rs
@@ -162,7 +162,7 @@ impl ChildBySource for EnumId {
         let arena_map = arena_map.as_ref();
         for (local_id, source) in arena_map.value.iter() {
             let id = EnumVariantId { parent: *self, local_id };
-            res[keys::ENUM_VARIANT].insert(arena_map.with_value(source.clone()), id)
+            res[keys::VARIANT].insert(arena_map.with_value(source.clone()), id)
         }
 
         res
diff --git a/crates/ra_hir_def/src/item_tree.rs b/crates/ra_hir_def/src/item_tree.rs
index 6b96a4c200..c478a9909d 100644
--- a/crates/ra_hir_def/src/item_tree.rs
+++ b/crates/ra_hir_def/src/item_tree.rs
@@ -416,9 +416,9 @@ mod_items! {
     Function in functions -> ast::Fn,
     Struct in structs -> ast::Struct,
     Union in unions -> ast::Union,
-    Enum in enums -> ast::EnumDef,
-    Const in consts -> ast::ConstDef,
-    Static in statics -> ast::StaticDef,
+    Enum in enums -> ast::Enum,
+    Const in consts -> ast::Const,
+    Static in statics -> ast::Static,
     Trait in traits -> ast::TraitDef,
     Impl in impls -> ast::ImplDef,
     TypeAlias in type_aliases -> ast::TypeAlias,
@@ -543,7 +543,7 @@ pub struct Enum {
     pub visibility: RawVisibilityId,
     pub generic_params: GenericParamsId,
     pub variants: IdRange<Variant>,
-    pub ast_id: FileAstId<ast::EnumDef>,
+    pub ast_id: FileAstId<ast::Enum>,
 }
 
 #[derive(Debug, Clone, Eq, PartialEq)]
@@ -552,7 +552,7 @@ pub struct Const {
     pub name: Option<Name>,
     pub visibility: RawVisibilityId,
     pub type_ref: TypeRef,
-    pub ast_id: FileAstId<ast::ConstDef>,
+    pub ast_id: FileAstId<ast::Const>,
 }
 
 #[derive(Debug, Clone, Eq, PartialEq)]
@@ -561,7 +561,7 @@ pub struct Static {
     pub visibility: RawVisibilityId,
     pub mutable: bool,
     pub type_ref: TypeRef,
-    pub ast_id: FileAstId<ast::StaticDef>,
+    pub ast_id: FileAstId<ast::Static>,
 }
 
 #[derive(Debug, Clone, Eq, PartialEq)]
diff --git a/crates/ra_hir_def/src/item_tree/lower.rs b/crates/ra_hir_def/src/item_tree/lower.rs
index a856180155..a94548e5d5 100644
--- a/crates/ra_hir_def/src/item_tree/lower.rs
+++ b/crates/ra_hir_def/src/item_tree/lower.rs
@@ -80,11 +80,11 @@ impl Ctx {
         match item {
             ast::Item::Struct(_)
             | ast::Item::Union(_)
-            | ast::Item::EnumDef(_)
+            | 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.
@@ -105,11 +105,11 @@ impl Ctx {
         let items = match item {
             ast::Item::Struct(ast) => self.lower_struct(ast).map(Into::into),
             ast::Item::Union(ast) => self.lower_union(ast).map(Into::into),
-            ast::Item::EnumDef(ast) => self.lower_enum(ast).map(Into::into),
+            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),
         }
     }
@@ -246,7 +246,7 @@ impl Ctx {
         Some(id(self.data().unions.alloc(res)))
     }
 
-    fn lower_enum(&mut self, enum_: &ast::EnumDef) -> Option<FileItemTreeId<Enum>> {
+    fn lower_enum(&mut self, enum_: &ast::Enum) -> Option<FileItemTreeId<Enum>> {
         let visibility = self.lower_visibility(enum_);
         let name = enum_.name()?.as_name();
         let generic_params = self.lower_generic_params(GenericsOwner::Enum, enum_);
@@ -259,7 +259,7 @@ impl Ctx {
         Some(id(self.data().enums.alloc(res)))
     }
 
-    fn lower_variants(&mut self, variants: &ast::EnumVariantList) -> IdRange<Variant> {
+    fn lower_variants(&mut self, variants: &ast::VariantList) -> IdRange<Variant> {
         let start = self.next_variant_idx();
         for variant in variants.variants() {
             if let Some(data) = self.lower_variant(&variant) {
@@ -271,7 +271,7 @@ impl Ctx {
         IdRange::new(start..end)
     }
 
-    fn lower_variant(&mut self, variant: &ast::EnumVariant) -> Option<Variant> {
+    fn lower_variant(&mut self, variant: &ast::Variant) -> Option<Variant> {
         let name = variant.name()?.as_name();
         let fields = self.lower_fields(&variant.kind());
         let res = Variant { name, fields };
@@ -368,7 +368,7 @@ impl Ctx {
         Some(id(self.data().type_aliases.alloc(res)))
     }
 
-    fn lower_static(&mut self, static_: &ast::StaticDef) -> Option<FileItemTreeId<Static>> {
+    fn lower_static(&mut self, static_: &ast::Static) -> Option<FileItemTreeId<Static>> {
         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<Const> {
+    fn lower_const(&mut self, konst: &ast::Const) -> FileItemTreeId<Const> {
         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()
                         }
diff --git a/crates/ra_hir_def/src/keys.rs b/crates/ra_hir_def/src/keys.rs
index d9ec0f3056..f75e3bb50f 100644
--- a/crates/ra_hir_def/src/keys.rs
+++ b/crates/ra_hir_def/src/keys.rs
@@ -15,16 +15,16 @@ use crate::{
 pub type Key<K, V> = crate::dyn_map::Key<InFile<K>, V, AstPtrPolicy<K, V>>;
 
 pub const FUNCTION: Key<ast::Fn, FunctionId> = Key::new();
-pub const CONST: Key<ast::ConstDef, ConstId> = Key::new();
-pub const STATIC: Key<ast::StaticDef, StaticId> = Key::new();
+pub const CONST: Key<ast::Const, ConstId> = Key::new();
+pub const STATIC: Key<ast::Static, StaticId> = Key::new();
 pub const TYPE_ALIAS: Key<ast::TypeAlias, TypeAliasId> = Key::new();
 pub const IMPL: Key<ast::ImplDef, ImplId> = Key::new();
 pub const TRAIT: Key<ast::TraitDef, TraitId> = Key::new();
 pub const STRUCT: Key<ast::Struct, StructId> = Key::new();
 pub const UNION: Key<ast::Union, UnionId> = Key::new();
-pub const ENUM: Key<ast::EnumDef, EnumId> = Key::new();
+pub const ENUM: Key<ast::Enum, EnumId> = Key::new();
 
-pub const ENUM_VARIANT: Key<ast::EnumVariant, EnumVariantId> = Key::new();
+pub const VARIANT: Key<ast::Variant, EnumVariantId> = Key::new();
 pub const TUPLE_FIELD: Key<ast::TupleField, FieldId> = Key::new();
 pub const RECORD_FIELD: Key<ast::RecordField, FieldId> = Key::new();
 pub const TYPE_PARAM: Key<ast::TypeParam, TypeParamId> = Key::new();
diff --git a/crates/ra_hir_expand/src/builtin_derive.rs b/crates/ra_hir_expand/src/builtin_derive.rs
index 489ec0513a..69fa907cb8 100644
--- a/crates/ra_hir_expand/src/builtin_derive.rs
+++ b/crates/ra_hir_expand/src/builtin_derive.rs
@@ -73,7 +73,7 @@ fn parse_adt(tt: &tt::Subtree) -> Result<BasicAdtInfo, mbe::ExpandError> {
     let (name, params) = match_ast! {
         match node {
             ast::Struct(it) => (it.name(), it.generic_param_list()),
-            ast::EnumDef(it) => (it.name(), it.generic_param_list()),
+            ast::Enum(it) => (it.name(), it.generic_param_list()),
             ast::Union(it) => (it.name(), it.generic_param_list()),
             _ => {
                 debug!("unexpected node is {:?}", node);
diff --git a/crates/ra_ide/src/completion/complete_trait_impl.rs b/crates/ra_ide/src/completion/complete_trait_impl.rs
index 7d9050a6b6..87221d964e 100644
--- a/crates/ra_ide/src/completion/complete_trait_impl.rs
+++ b/crates/ra_ide/src/completion/complete_trait_impl.rs
@@ -2,7 +2,7 @@
 //!
 //! This module adds the completion items related to implementing associated
 //! items within a `impl Trait for Struct` block. The current context node
-//! must be within either a `FN`, `TYPE_ALIAS`, or `CONST_DEF` node
+//! must be within either a `FN`, `TYPE_ALIAS`, or `CONST` node
 //! and an direct child of an `IMPL_DEF`.
 //!
 //! # Examples
@@ -87,7 +87,7 @@ pub(crate) fn complete_trait_impl(acc: &mut Completions, ctx: &CompletionContext
                 }
             }
 
-            SyntaxKind::CONST_DEF => {
+            SyntaxKind::CONST => {
                 for missing_fn in get_missing_assoc_items(&ctx.sema, &impl_def)
                     .into_iter()
                     .filter_map(|item| match item {
@@ -106,10 +106,9 @@ pub(crate) fn complete_trait_impl(acc: &mut Completions, ctx: &CompletionContext
 
 fn completion_match(ctx: &CompletionContext) -> Option<(SyntaxNode, ImplDef)> {
     let (trigger, impl_def_offset) = ctx.token.ancestors().find_map(|p| match p.kind() {
-        SyntaxKind::FN
-        | SyntaxKind::TYPE_ALIAS
-        | SyntaxKind::CONST_DEF
-        | SyntaxKind::BLOCK_EXPR => Some((p, 2)),
+        SyntaxKind::FN | SyntaxKind::TYPE_ALIAS | SyntaxKind::CONST | SyntaxKind::BLOCK_EXPR => {
+            Some((p, 2))
+        }
         SyntaxKind::NAME_REF => Some((p, 5)),
         _ => None,
     })?;
@@ -201,7 +200,7 @@ fn add_const_impl(
     }
 }
 
-fn make_const_compl_syntax(const_: &ast::ConstDef) -> String {
+fn make_const_compl_syntax(const_: &ast::Const) -> String {
     let const_ = edit::remove_attrs_and_docs(const_);
 
     let const_start = const_.syntax().text_range().start();
diff --git a/crates/ra_ide/src/display.rs b/crates/ra_ide/src/display.rs
index e81e8436f7..3efca06496 100644
--- a/crates/ra_ide/src/display.rs
+++ b/crates/ra_ide/src/display.rs
@@ -54,7 +54,7 @@ pub(crate) fn function_declaration(node: &ast::Fn) -> String {
     buf
 }
 
-pub(crate) fn const_label(node: &ast::ConstDef) -> String {
+pub(crate) fn const_label(node: &ast::Const) -> String {
     let label: String = node
         .syntax()
         .children_with_tokens()
diff --git a/crates/ra_ide/src/display/navigation_target.rs b/crates/ra_ide/src/display/navigation_target.rs
index 5686faaabc..9e2c012456 100644
--- a/crates/ra_ide/src/display/navigation_target.rs
+++ b/crates/ra_ide/src/display/navigation_target.rs
@@ -381,14 +381,14 @@ pub(crate) fn docs_from_symbol(db: &RootDatabase, symbol: &FileSymbol) -> Option
         match node {
             ast::Fn(it) => it.doc_comment_text(),
             ast::Struct(it) => it.doc_comment_text(),
-            ast::EnumDef(it) => it.doc_comment_text(),
+            ast::Enum(it) => it.doc_comment_text(),
             ast::TraitDef(it) => it.doc_comment_text(),
             ast::Module(it) => it.doc_comment_text(),
             ast::TypeAlias(it) => it.doc_comment_text(),
-            ast::ConstDef(it) => it.doc_comment_text(),
-            ast::StaticDef(it) => it.doc_comment_text(),
+            ast::Const(it) => it.doc_comment_text(),
+            ast::Static(it) => it.doc_comment_text(),
             ast::RecordField(it) => it.doc_comment_text(),
-            ast::EnumVariant(it) => it.doc_comment_text(),
+            ast::Variant(it) => it.doc_comment_text(),
             ast::MacroCall(it) => it.doc_comment_text(),
             _ => None,
         }
@@ -406,14 +406,14 @@ pub(crate) fn description_from_symbol(db: &RootDatabase, symbol: &FileSymbol) ->
         match node {
             ast::Fn(it) => it.short_label(),
             ast::Struct(it) => it.short_label(),
-            ast::EnumDef(it) => it.short_label(),
+            ast::Enum(it) => it.short_label(),
             ast::TraitDef(it) => it.short_label(),
             ast::Module(it) => it.short_label(),
             ast::TypeAlias(it) => it.short_label(),
-            ast::ConstDef(it) => it.short_label(),
-            ast::StaticDef(it) => it.short_label(),
+            ast::Const(it) => it.short_label(),
+            ast::Static(it) => it.short_label(),
             ast::RecordField(it) => it.short_label(),
-            ast::EnumVariant(it) => it.short_label(),
+            ast::Variant(it) => it.short_label(),
             _ => None,
         }
     }
@@ -446,7 +446,7 @@ fn foo() { enum FooInner { } }
                         5..13,
                     ),
                     name: "FooInner",
-                    kind: ENUM_DEF,
+                    kind: ENUM,
                     container_name: None,
                     description: Some(
                         "enum FooInner",
@@ -462,7 +462,7 @@ fn foo() { enum FooInner { } }
                         34..42,
                     ),
                     name: "FooInner",
-                    kind: ENUM_DEF,
+                    kind: ENUM,
                     container_name: Some(
                         "foo",
                     ),
diff --git a/crates/ra_ide/src/display/short_label.rs b/crates/ra_ide/src/display/short_label.rs
index 504b884c58..282f362f29 100644
--- a/crates/ra_ide/src/display/short_label.rs
+++ b/crates/ra_ide/src/display/short_label.rs
@@ -25,7 +25,7 @@ impl ShortLabel for ast::Union {
     }
 }
 
-impl ShortLabel for ast::EnumDef {
+impl ShortLabel for ast::Enum {
     fn short_label(&self) -> Option<String> {
         short_label_from_node(self, "enum ")
     }
@@ -53,13 +53,13 @@ impl ShortLabel for ast::TypeAlias {
     }
 }
 
-impl ShortLabel for ast::ConstDef {
+impl ShortLabel for ast::Const {
     fn short_label(&self) -> Option<String> {
         short_label_from_ascribed_node(self, "const ")
     }
 }
 
-impl ShortLabel for ast::StaticDef {
+impl ShortLabel for ast::Static {
     fn short_label(&self) -> Option<String> {
         short_label_from_ascribed_node(self, "static ")
     }
@@ -71,7 +71,7 @@ impl ShortLabel for ast::RecordField {
     }
 }
 
-impl ShortLabel for ast::EnumVariant {
+impl ShortLabel for ast::Variant {
     fn short_label(&self) -> Option<String> {
         Some(self.name()?.text().to_string())
     }
diff --git a/crates/ra_ide/src/extend_selection.rs b/crates/ra_ide/src/extend_selection.rs
index 04a7f0ac4b..fc81b48cce 100644
--- a/crates/ra_ide/src/extend_selection.rs
+++ b/crates/ra_ide/src/extend_selection.rs
@@ -42,7 +42,7 @@ fn try_extend_selection(
         RECORD_FIELD_LIST,
         TUPLE_FIELD_LIST,
         RECORD_EXPR_FIELD_LIST,
-        ENUM_VARIANT_LIST,
+        VARIANT_LIST,
         USE_TREE_LIST,
         GENERIC_PARAM_LIST,
         TYPE_ARG_LIST,
diff --git a/crates/ra_ide/src/file_structure.rs b/crates/ra_ide/src/file_structure.rs
index 6f198fcbc6..77384b6ecc 100644
--- a/crates/ra_ide/src/file_structure.rs
+++ b/crates/ra_ide/src/file_structure.rs
@@ -128,8 +128,8 @@ fn structure_node(node: &SyntaxNode) -> Option<StructureNode> {
             },
             ast::Struct(it) => decl(it),
             ast::Union(it) => decl(it),
-            ast::EnumDef(it) => decl(it),
-            ast::EnumVariant(it) => decl(it),
+            ast::Enum(it) => decl(it),
+            ast::Variant(it) => decl(it),
             ast::TraitDef(it) => decl(it),
             ast::Module(it) => decl(it),
             ast::TypeAlias(it) => {
@@ -137,8 +137,8 @@ fn structure_node(node: &SyntaxNode) -> Option<StructureNode> {
                 decl_with_type_ref(it, ty)
             },
             ast::RecordField(it) => decl_with_ascription(it),
-            ast::ConstDef(it) => decl_with_ascription(it),
-            ast::StaticDef(it) => decl_with_ascription(it),
+            ast::Const(it) => decl_with_ascription(it),
+            ast::Static(it) => decl_with_ascription(it),
             ast::ImplDef(it) => {
                 let target_type = it.target_type()?;
                 let target_trait = it.target_trait();
@@ -308,7 +308,7 @@ fn very_obsolete() {}
                         label: "E",
                         navigation_range: 165..166,
                         node_range: 160..180,
-                        kind: ENUM_DEF,
+                        kind: ENUM,
                         detail: None,
                         deprecated: false,
                     },
@@ -319,7 +319,7 @@ fn very_obsolete() {}
                         label: "X",
                         navigation_range: 169..170,
                         node_range: 169..170,
-                        kind: ENUM_VARIANT,
+                        kind: VARIANT,
                         detail: None,
                         deprecated: false,
                     },
@@ -330,7 +330,7 @@ fn very_obsolete() {}
                         label: "Y",
                         navigation_range: 172..173,
                         node_range: 172..178,
-                        kind: ENUM_VARIANT,
+                        kind: VARIANT,
                         detail: None,
                         deprecated: false,
                     },
@@ -350,7 +350,7 @@ fn very_obsolete() {}
                         label: "S",
                         navigation_range: 201..202,
                         node_range: 194..213,
-                        kind: STATIC_DEF,
+                        kind: STATIC,
                         detail: Some(
                             "i32",
                         ),
@@ -361,7 +361,7 @@ fn very_obsolete() {}
                         label: "C",
                         navigation_range: 220..221,
                         node_range: 214..232,
-                        kind: CONST_DEF,
+                        kind: CONST,
                         detail: Some(
                             "i32",
                         ),
diff --git a/crates/ra_ide/src/folding_ranges.rs b/crates/ra_ide/src/folding_ranges.rs
index 8dcce9f56f..5a6e17936f 100644
--- a/crates/ra_ide/src/folding_ranges.rs
+++ b/crates/ra_ide/src/folding_ranges.rs
@@ -93,7 +93,7 @@ fn fold_kind(kind: SyntaxKind) -> Option<FoldKind> {
         | USE_TREE_LIST
         | BLOCK_EXPR
         | MATCH_ARM_LIST
-        | ENUM_VARIANT_LIST
+        | VARIANT_LIST
         | TOKEN_TREE => Some(FoldKind::Block),
         _ => None,
     }
diff --git a/crates/ra_ide/src/goto_implementation.rs b/crates/ra_ide/src/goto_implementation.rs
index 699fad57d1..e2f7e63736 100644
--- a/crates/ra_ide/src/goto_implementation.rs
+++ b/crates/ra_ide/src/goto_implementation.rs
@@ -45,7 +45,7 @@ fn impls_for_def(
 ) -> Option<Vec<NavigationTarget>> {
     let ty = match node {
         ast::AdtDef::Struct(def) => sema.to_def(def)?.ty(sema.db),
-        ast::AdtDef::EnumDef(def) => sema.to_def(def)?.ty(sema.db),
+        ast::AdtDef::Enum(def) => sema.to_def(def)?.ty(sema.db),
         ast::AdtDef::Union(def) => sema.to_def(def)?.ty(sema.db),
     };
 
diff --git a/crates/ra_ide/src/references.rs b/crates/ra_ide/src/references.rs
index 2a62dab6cb..519e4bf1a2 100644
--- a/crates/ra_ide/src/references.rs
+++ b/crates/ra_ide/src/references.rs
@@ -390,7 +390,7 @@ enum Foo {
 }
 "#,
         );
-        check_result(refs, "B ENUM_VARIANT FileId(1) 22..23 22..23 Other", &[]);
+        check_result(refs, "B VARIANT FileId(1) 22..23 22..23 Other", &[]);
     }
 
     #[test]
diff --git a/crates/ra_ide/src/syntax_highlighting.rs b/crates/ra_ide/src/syntax_highlighting.rs
index ba1fd62427..19ec73d2ab 100644
--- a/crates/ra_ide/src/syntax_highlighting.rs
+++ b/crates/ra_ide/src/syntax_highlighting.rs
@@ -706,7 +706,7 @@ fn highlight_name_by_syntax(name: ast::Name) -> Highlight {
 
     let tag = match parent.kind() {
         STRUCT => HighlightTag::Struct,
-        ENUM_DEF => HighlightTag::Enum,
+        ENUM => HighlightTag::Enum,
         UNION => HighlightTag::Union,
         TRAIT_DEF => HighlightTag::Trait,
         TYPE_ALIAS => HighlightTag::TypeAlias,
@@ -714,9 +714,9 @@ fn highlight_name_by_syntax(name: ast::Name) -> Highlight {
         RECORD_FIELD => HighlightTag::Field,
         MODULE => HighlightTag::Module,
         FN => HighlightTag::Function,
-        CONST_DEF => HighlightTag::Constant,
-        STATIC_DEF => HighlightTag::Static,
-        ENUM_VARIANT => HighlightTag::EnumVariant,
+        CONST => HighlightTag::Constant,
+        STATIC => HighlightTag::Static,
+        VARIANT => HighlightTag::EnumVariant,
         BIND_PAT => HighlightTag::Local,
         _ => default,
     };
diff --git a/crates/ra_ide_db/src/defs.rs b/crates/ra_ide_db/src/defs.rs
index 6a2180f6c2..b908bd741b 100644
--- a/crates/ra_ide_db/src/defs.rs
+++ b/crates/ra_ide_db/src/defs.rs
@@ -158,7 +158,7 @@ pub fn classify_name(sema: &Semantics<RootDatabase>, name: &ast::Name) -> Option
                 let def: hir::Union = sema.to_def(&it)?;
                 Some(NameClass::Definition(Definition::ModuleDef(def.into())))
             },
-            ast::EnumDef(it) => {
+            ast::Enum(it) => {
                 let def: hir::Enum = sema.to_def(&it)?;
                 Some(NameClass::Definition(Definition::ModuleDef(def.into())))
             },
@@ -166,11 +166,11 @@ pub fn classify_name(sema: &Semantics<RootDatabase>, name: &ast::Name) -> Option
                 let def: hir::Trait = sema.to_def(&it)?;
                 Some(NameClass::Definition(Definition::ModuleDef(def.into())))
             },
-            ast::StaticDef(it) => {
+            ast::Static(it) => {
                 let def: hir::Static = sema.to_def(&it)?;
                 Some(NameClass::Definition(Definition::ModuleDef(def.into())))
             },
-            ast::EnumVariant(it) => {
+            ast::Variant(it) => {
                 let def: hir::EnumVariant = sema.to_def(&it)?;
                 Some(NameClass::Definition(Definition::ModuleDef(def.into())))
             },
@@ -178,7 +178,7 @@ pub fn classify_name(sema: &Semantics<RootDatabase>, name: &ast::Name) -> Option
                 let def: hir::Function = sema.to_def(&it)?;
                 Some(NameClass::Definition(Definition::ModuleDef(def.into())))
             },
-            ast::ConstDef(it) => {
+            ast::Const(it) => {
                 let def: hir::Const = sema.to_def(&it)?;
                 Some(NameClass::Definition(Definition::ModuleDef(def.into())))
             },
diff --git a/crates/ra_ide_db/src/symbol_index.rs b/crates/ra_ide_db/src/symbol_index.rs
index da19f0f33d..41b8d07f4d 100644
--- a/crates/ra_ide_db/src/symbol_index.rs
+++ b/crates/ra_ide_db/src/symbol_index.rs
@@ -344,7 +344,7 @@ impl Query {
 }
 
 fn is_type(kind: SyntaxKind) -> bool {
-    matches!(kind, STRUCT | ENUM_DEF | TRAIT_DEF | TYPE_ALIAS)
+    matches!(kind, STRUCT | ENUM | TRAIT_DEF | TYPE_ALIAS)
 }
 
 /// The actual data that is stored in the index. It should be as compact as
@@ -399,12 +399,12 @@ fn to_symbol(node: &SyntaxNode) -> Option<(SmolStr, SyntaxNodePtr, TextRange)> {
         match node {
             ast::Fn(it) => decl(it),
             ast::Struct(it) => decl(it),
-            ast::EnumDef(it) => decl(it),
+            ast::Enum(it) => decl(it),
             ast::TraitDef(it) => decl(it),
             ast::Module(it) => decl(it),
             ast::TypeAlias(it) => decl(it),
-            ast::ConstDef(it) => decl(it),
-            ast::StaticDef(it) => decl(it),
+            ast::Const(it) => decl(it),
+            ast::Static(it) => decl(it),
             ast::MacroCall(it) => {
                 if it.is_macro_rules().is_some() {
                     decl(it)
diff --git a/crates/ra_parser/src/grammar.rs b/crates/ra_parser/src/grammar.rs
index 03041d1108..22a7acdf31 100644
--- a/crates/ra_parser/src/grammar.rs
+++ b/crates/ra_parser/src/grammar.rs
@@ -144,7 +144,7 @@ pub(crate) fn reparser(
         BLOCK_EXPR => expressions::block_expr,
         RECORD_FIELD_LIST => items::record_field_def_list,
         RECORD_EXPR_FIELD_LIST => items::record_field_list,
-        ENUM_VARIANT_LIST => items::enum_variant_list,
+        VARIANT_LIST => items::enum_variant_list,
         MATCH_ARM_LIST => items::match_arm_list,
         USE_TREE_LIST => items::use_tree_list,
         EXTERN_ITEM_LIST => items::extern_item_list,
diff --git a/crates/ra_parser/src/grammar/items/adt.rs b/crates/ra_parser/src/grammar/items/adt.rs
index 2f5cfb6b6d..addfb59d4b 100644
--- a/crates/ra_parser/src/grammar/items/adt.rs
+++ b/crates/ra_parser/src/grammar/items/adt.rs
@@ -64,7 +64,7 @@ pub(super) fn enum_def(p: &mut Parser, m: Marker) {
     } else {
         p.error("expected `{`")
     }
-    m.complete(p, ENUM_DEF);
+    m.complete(p, ENUM);
 }
 
 pub(crate) fn enum_variant_list(p: &mut Parser) {
@@ -91,7 +91,7 @@ pub(crate) fn enum_variant_list(p: &mut Parser) {
             if p.eat(T![=]) {
                 expressions::expr(p);
             }
-            var.complete(p, ENUM_VARIANT);
+            var.complete(p, VARIANT);
         } else {
             var.abandon(p);
             p.err_and_bump("expected enum variant");
@@ -101,7 +101,7 @@ pub(crate) fn enum_variant_list(p: &mut Parser) {
         }
     }
     p.expect(T!['}']);
-    m.complete(p, ENUM_VARIANT_LIST);
+    m.complete(p, VARIANT_LIST);
 }
 
 pub(crate) fn record_field_def_list(p: &mut Parser) {
diff --git a/crates/ra_parser/src/grammar/items/consts.rs b/crates/ra_parser/src/grammar/items/consts.rs
index 742a7e0562..35ad766dce 100644
--- a/crates/ra_parser/src/grammar/items/consts.rs
+++ b/crates/ra_parser/src/grammar/items/consts.rs
@@ -3,11 +3,11 @@
 use super::*;
 
 pub(super) fn static_def(p: &mut Parser, m: Marker) {
-    const_or_static(p, m, T![static], STATIC_DEF)
+    const_or_static(p, m, T![static], STATIC)
 }
 
 pub(super) fn const_def(p: &mut Parser, m: Marker) {
-    const_or_static(p, m, T![const], CONST_DEF)
+    const_or_static(p, m, T![const], CONST)
 }
 
 fn const_or_static(p: &mut Parser, m: Marker, kw: SyntaxKind, def: SyntaxKind) {
diff --git a/crates/ra_parser/src/syntax_kind/generated.rs b/crates/ra_parser/src/syntax_kind/generated.rs
index 4fad765c7c..64889676eb 100644
--- a/crates/ra_parser/src/syntax_kind/generated.rs
+++ b/crates/ra_parser/src/syntax_kind/generated.rs
@@ -125,14 +125,14 @@ pub enum SyntaxKind {
     SOURCE_FILE,
     STRUCT,
     UNION,
-    ENUM_DEF,
+    ENUM,
     FN,
     RET_TYPE,
     EXTERN_CRATE,
     MODULE,
     USE,
-    STATIC_DEF,
-    CONST_DEF,
+    STATIC,
+    CONST,
     TRAIT_DEF,
     IMPL_DEF,
     TYPE_ALIAS,
@@ -206,12 +206,12 @@ pub enum SyntaxKind {
     BIN_EXPR,
     EXTERN_BLOCK,
     EXTERN_ITEM_LIST,
-    ENUM_VARIANT,
+    VARIANT,
     RECORD_FIELD_LIST,
     RECORD_FIELD,
     TUPLE_FIELD_LIST,
     TUPLE_FIELD,
-    ENUM_VARIANT_LIST,
+    VARIANT_LIST,
     ITEM_LIST,
     ASSOC_ITEM_LIST,
     ATTR,
diff --git a/crates/ra_syntax/src/ast.rs b/crates/ra_syntax/src/ast.rs
index b69b6e85e9..fd426ece9d 100644
--- a/crates/ra_syntax/src/ast.rs
+++ b/crates/ra_syntax/src/ast.rs
@@ -139,7 +139,7 @@ fn test_doc_comment_of_statics() {
     )
     .ok()
     .unwrap();
-    let st = file.syntax().descendants().find_map(StaticDef::cast).unwrap();
+    let st = file.syntax().descendants().find_map(Static::cast).unwrap();
     assert_eq!("Number of levels", st.doc_comment_text().unwrap());
 }
 
diff --git a/crates/ra_syntax/src/ast/generated/nodes.rs b/crates/ra_syntax/src/ast/generated/nodes.rs
index 0fd3d4f1b5..00a70fce09 100644
--- a/crates/ra_syntax/src/ast/generated/nodes.rs
+++ b/crates/ra_syntax/src/ast/generated/nodes.rs
@@ -28,32 +28,33 @@ impl Attr {
     pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
-pub struct ConstDef {
+pub struct Const {
     pub(crate) syntax: SyntaxNode,
 }
-impl ast::AttrsOwner for ConstDef {}
-impl ast::NameOwner for ConstDef {}
-impl ast::VisibilityOwner for ConstDef {}
-impl ast::TypeAscriptionOwner for ConstDef {}
-impl ConstDef {
+impl ast::AttrsOwner for Const {}
+impl ast::NameOwner for Const {}
+impl ast::VisibilityOwner for Const {}
+impl ast::TypeAscriptionOwner for Const {}
+impl Const {
     pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) }
     pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
+    pub fn underscore_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![_]) }
     pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) }
     pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
     pub fn body(&self) -> Option<Expr> { support::child(&self.syntax) }
     pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
-pub struct EnumDef {
+pub struct Enum {
     pub(crate) syntax: SyntaxNode,
 }
-impl ast::AttrsOwner for EnumDef {}
-impl ast::NameOwner for EnumDef {}
-impl ast::VisibilityOwner for EnumDef {}
-impl ast::GenericParamsOwner for EnumDef {}
-impl EnumDef {
+impl ast::AttrsOwner for Enum {}
+impl ast::NameOwner for Enum {}
+impl ast::VisibilityOwner for Enum {}
+impl ast::GenericParamsOwner for Enum {}
+impl Enum {
     pub fn enum_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![enum]) }
-    pub fn variant_list(&self) -> Option<EnumVariantList> { support::child(&self.syntax) }
+    pub fn variant_list(&self) -> Option<VariantList> { support::child(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct ExternBlock {
@@ -139,14 +140,14 @@ impl Module {
     pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
-pub struct StaticDef {
+pub struct Static {
     pub(crate) syntax: SyntaxNode,
 }
-impl ast::AttrsOwner for StaticDef {}
-impl ast::NameOwner for StaticDef {}
-impl ast::VisibilityOwner for StaticDef {}
-impl ast::TypeAscriptionOwner for StaticDef {}
-impl StaticDef {
+impl ast::AttrsOwner for Static {}
+impl ast::NameOwner for Static {}
+impl ast::VisibilityOwner for Static {}
+impl ast::TypeAscriptionOwner for Static {}
+impl Static {
     pub fn static_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![static]) }
     pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) }
     pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) }
@@ -427,22 +428,22 @@ impl TupleField {
     pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
-pub struct EnumVariantList {
+pub struct VariantList {
     pub(crate) syntax: SyntaxNode,
 }
-impl EnumVariantList {
+impl VariantList {
     pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) }
-    pub fn variants(&self) -> AstChildren<EnumVariant> { support::children(&self.syntax) }
+    pub fn variants(&self) -> AstChildren<Variant> { support::children(&self.syntax) }
     pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
-pub struct EnumVariant {
+pub struct Variant {
     pub(crate) syntax: SyntaxNode,
 }
-impl ast::AttrsOwner for EnumVariant {}
-impl ast::NameOwner for EnumVariant {}
-impl ast::VisibilityOwner for EnumVariant {}
-impl EnumVariant {
+impl ast::AttrsOwner for Variant {}
+impl ast::NameOwner for Variant {}
+impl ast::VisibilityOwner for Variant {}
+impl Variant {
     pub fn field_list(&self) -> Option<FieldList> { support::child(&self.syntax) }
     pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
     pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
@@ -1272,15 +1273,15 @@ impl MetaItem {
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub enum Item {
-    ConstDef(ConstDef),
-    EnumDef(EnumDef),
+    Const(Const),
+    Enum(Enum),
     ExternBlock(ExternBlock),
     ExternCrate(ExternCrate),
     Fn(Fn),
     ImplDef(ImplDef),
     MacroCall(MacroCall),
     Module(Module),
-    StaticDef(StaticDef),
+    Static(Static),
     Struct(Struct),
     TraitDef(TraitDef),
     TypeAlias(TypeAlias),
@@ -1365,7 +1366,7 @@ pub enum Expr {
 pub enum AssocItem {
     Fn(Fn),
     TypeAlias(TypeAlias),
-    ConstDef(ConstDef),
+    Const(Const),
     MacroCall(MacroCall),
 }
 impl ast::AttrsOwner for AssocItem {}
@@ -1384,7 +1385,7 @@ pub enum AttrInput {
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub enum ExternItem {
     Fn(Fn),
-    StaticDef(StaticDef),
+    Static(Static),
 }
 impl ast::AttrsOwner for ExternItem {}
 impl ast::NameOwner for ExternItem {}
@@ -1392,7 +1393,7 @@ impl ast::VisibilityOwner for ExternItem {}
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub enum AdtDef {
     Struct(Struct),
-    EnumDef(EnumDef),
+    Enum(Enum),
     Union(Union),
 }
 impl ast::AttrsOwner for AdtDef {}
@@ -1421,8 +1422,8 @@ impl AstNode for Attr {
     }
     fn syntax(&self) -> &SyntaxNode { &self.syntax }
 }
-impl AstNode for ConstDef {
-    fn can_cast(kind: SyntaxKind) -> bool { kind == CONST_DEF }
+impl AstNode for Const {
+    fn can_cast(kind: SyntaxKind) -> bool { kind == CONST }
     fn cast(syntax: SyntaxNode) -> Option<Self> {
         if Self::can_cast(syntax.kind()) {
             Some(Self { syntax })
@@ -1432,8 +1433,8 @@ impl AstNode for ConstDef {
     }
     fn syntax(&self) -> &SyntaxNode { &self.syntax }
 }
-impl AstNode for EnumDef {
-    fn can_cast(kind: SyntaxKind) -> bool { kind == ENUM_DEF }
+impl AstNode for Enum {
+    fn can_cast(kind: SyntaxKind) -> bool { kind == ENUM }
     fn cast(syntax: SyntaxNode) -> Option<Self> {
         if Self::can_cast(syntax.kind()) {
             Some(Self { syntax })
@@ -1509,8 +1510,8 @@ impl AstNode for Module {
     }
     fn syntax(&self) -> &SyntaxNode { &self.syntax }
 }
-impl AstNode for StaticDef {
-    fn can_cast(kind: SyntaxKind) -> bool { kind == STATIC_DEF }
+impl AstNode for Static {
+    fn can_cast(kind: SyntaxKind) -> bool { kind == STATIC }
     fn cast(syntax: SyntaxNode) -> Option<Self> {
         if Self::can_cast(syntax.kind()) {
             Some(Self { syntax })
@@ -1806,8 +1807,8 @@ impl AstNode for TupleField {
     }
     fn syntax(&self) -> &SyntaxNode { &self.syntax }
 }
-impl AstNode for EnumVariantList {
-    fn can_cast(kind: SyntaxKind) -> bool { kind == ENUM_VARIANT_LIST }
+impl AstNode for VariantList {
+    fn can_cast(kind: SyntaxKind) -> bool { kind == VARIANT_LIST }
     fn cast(syntax: SyntaxNode) -> Option<Self> {
         if Self::can_cast(syntax.kind()) {
             Some(Self { syntax })
@@ -1817,8 +1818,8 @@ impl AstNode for EnumVariantList {
     }
     fn syntax(&self) -> &SyntaxNode { &self.syntax }
 }
-impl AstNode for EnumVariant {
-    fn can_cast(kind: SyntaxKind) -> bool { kind == ENUM_VARIANT }
+impl AstNode for Variant {
+    fn can_cast(kind: SyntaxKind) -> bool { kind == VARIANT }
     fn cast(syntax: SyntaxNode) -> Option<Self> {
         if Self::can_cast(syntax.kind()) {
             Some(Self { syntax })
@@ -2774,11 +2775,11 @@ impl AstNode for MetaItem {
     }
     fn syntax(&self) -> &SyntaxNode { &self.syntax }
 }
-impl From<ConstDef> for Item {
-    fn from(node: ConstDef) -> Item { Item::ConstDef(node) }
+impl From<Const> for Item {
+    fn from(node: Const) -> Item { Item::Const(node) }
 }
-impl From<EnumDef> for Item {
-    fn from(node: EnumDef) -> Item { Item::EnumDef(node) }
+impl From<Enum> for Item {
+    fn from(node: Enum) -> Item { Item::Enum(node) }
 }
 impl From<ExternBlock> for Item {
     fn from(node: ExternBlock) -> Item { Item::ExternBlock(node) }
@@ -2798,8 +2799,8 @@ impl From<MacroCall> for Item {
 impl From<Module> for Item {
     fn from(node: Module) -> Item { Item::Module(node) }
 }
-impl From<StaticDef> for Item {
-    fn from(node: StaticDef) -> Item { Item::StaticDef(node) }
+impl From<Static> for Item {
+    fn from(node: Static) -> Item { Item::Static(node) }
 }
 impl From<Struct> for Item {
     fn from(node: Struct) -> Item { Item::Struct(node) }
@@ -2819,22 +2820,22 @@ impl From<Use> for Item {
 impl AstNode for Item {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
-            CONST_DEF | ENUM_DEF | EXTERN_BLOCK | EXTERN_CRATE | FN | IMPL_DEF | MACRO_CALL
-            | MODULE | STATIC_DEF | STRUCT | TRAIT_DEF | TYPE_ALIAS | UNION | USE => true,
+            CONST | ENUM | EXTERN_BLOCK | EXTERN_CRATE | FN | IMPL_DEF | MACRO_CALL | MODULE
+            | STATIC | STRUCT | TRAIT_DEF | TYPE_ALIAS | UNION | USE => true,
             _ => false,
         }
     }
     fn cast(syntax: SyntaxNode) -> Option<Self> {
         let res = match syntax.kind() {
-            CONST_DEF => Item::ConstDef(ConstDef { syntax }),
-            ENUM_DEF => Item::EnumDef(EnumDef { syntax }),
+            CONST => Item::Const(Const { syntax }),
+            ENUM => Item::Enum(Enum { syntax }),
             EXTERN_BLOCK => Item::ExternBlock(ExternBlock { syntax }),
             EXTERN_CRATE => Item::ExternCrate(ExternCrate { syntax }),
             FN => Item::Fn(Fn { syntax }),
             IMPL_DEF => Item::ImplDef(ImplDef { syntax }),
             MACRO_CALL => Item::MacroCall(MacroCall { syntax }),
             MODULE => Item::Module(Module { syntax }),
-            STATIC_DEF => Item::StaticDef(StaticDef { syntax }),
+            STATIC => Item::Static(Static { syntax }),
             STRUCT => Item::Struct(Struct { syntax }),
             TRAIT_DEF => Item::TraitDef(TraitDef { syntax }),
             TYPE_ALIAS => Item::TypeAlias(TypeAlias { syntax }),
@@ -2846,15 +2847,15 @@ impl AstNode for Item {
     }
     fn syntax(&self) -> &SyntaxNode {
         match self {
-            Item::ConstDef(it) => &it.syntax,
-            Item::EnumDef(it) => &it.syntax,
+            Item::Const(it) => &it.syntax,
+            Item::Enum(it) => &it.syntax,
             Item::ExternBlock(it) => &it.syntax,
             Item::ExternCrate(it) => &it.syntax,
             Item::Fn(it) => &it.syntax,
             Item::ImplDef(it) => &it.syntax,
             Item::MacroCall(it) => &it.syntax,
             Item::Module(it) => &it.syntax,
-            Item::StaticDef(it) => &it.syntax,
+            Item::Static(it) => &it.syntax,
             Item::Struct(it) => &it.syntax,
             Item::TraitDef(it) => &it.syntax,
             Item::TypeAlias(it) => &it.syntax,
@@ -3256,8 +3257,8 @@ impl From<Fn> for AssocItem {
 impl From<TypeAlias> for AssocItem {
     fn from(node: TypeAlias) -> AssocItem { AssocItem::TypeAlias(node) }
 }
-impl From<ConstDef> for AssocItem {
-    fn from(node: ConstDef) -> AssocItem { AssocItem::ConstDef(node) }
+impl From<Const> for AssocItem {
+    fn from(node: Const) -> AssocItem { AssocItem::Const(node) }
 }
 impl From<MacroCall> for AssocItem {
     fn from(node: MacroCall) -> AssocItem { AssocItem::MacroCall(node) }
@@ -3265,7 +3266,7 @@ impl From<MacroCall> for AssocItem {
 impl AstNode for AssocItem {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
-            FN | TYPE_ALIAS | CONST_DEF | MACRO_CALL => true,
+            FN | TYPE_ALIAS | CONST | MACRO_CALL => true,
             _ => false,
         }
     }
@@ -3273,7 +3274,7 @@ impl AstNode for AssocItem {
         let res = match syntax.kind() {
             FN => AssocItem::Fn(Fn { syntax }),
             TYPE_ALIAS => AssocItem::TypeAlias(TypeAlias { syntax }),
-            CONST_DEF => AssocItem::ConstDef(ConstDef { syntax }),
+            CONST => AssocItem::Const(Const { syntax }),
             MACRO_CALL => AssocItem::MacroCall(MacroCall { syntax }),
             _ => return None,
         };
@@ -3283,7 +3284,7 @@ impl AstNode for AssocItem {
         match self {
             AssocItem::Fn(it) => &it.syntax,
             AssocItem::TypeAlias(it) => &it.syntax,
-            AssocItem::ConstDef(it) => &it.syntax,
+            AssocItem::Const(it) => &it.syntax,
             AssocItem::MacroCall(it) => &it.syntax,
         }
     }
@@ -3347,20 +3348,20 @@ impl AstNode for AttrInput {
 impl From<Fn> for ExternItem {
     fn from(node: Fn) -> ExternItem { ExternItem::Fn(node) }
 }
-impl From<StaticDef> for ExternItem {
-    fn from(node: StaticDef) -> ExternItem { ExternItem::StaticDef(node) }
+impl From<Static> for ExternItem {
+    fn from(node: Static) -> ExternItem { ExternItem::Static(node) }
 }
 impl AstNode for ExternItem {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
-            FN | STATIC_DEF => true,
+            FN | STATIC => true,
             _ => false,
         }
     }
     fn cast(syntax: SyntaxNode) -> Option<Self> {
         let res = match syntax.kind() {
             FN => ExternItem::Fn(Fn { syntax }),
-            STATIC_DEF => ExternItem::StaticDef(StaticDef { syntax }),
+            STATIC => ExternItem::Static(Static { syntax }),
             _ => return None,
         };
         Some(res)
@@ -3368,15 +3369,15 @@ impl AstNode for ExternItem {
     fn syntax(&self) -> &SyntaxNode {
         match self {
             ExternItem::Fn(it) => &it.syntax,
-            ExternItem::StaticDef(it) => &it.syntax,
+            ExternItem::Static(it) => &it.syntax,
         }
     }
 }
 impl From<Struct> for AdtDef {
     fn from(node: Struct) -> AdtDef { AdtDef::Struct(node) }
 }
-impl From<EnumDef> for AdtDef {
-    fn from(node: EnumDef) -> AdtDef { AdtDef::EnumDef(node) }
+impl From<Enum> for AdtDef {
+    fn from(node: Enum) -> AdtDef { AdtDef::Enum(node) }
 }
 impl From<Union> for AdtDef {
     fn from(node: Union) -> AdtDef { AdtDef::Union(node) }
@@ -3384,14 +3385,14 @@ impl From<Union> for AdtDef {
 impl AstNode for AdtDef {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
-            STRUCT | ENUM_DEF | UNION => true,
+            STRUCT | ENUM | UNION => true,
             _ => false,
         }
     }
     fn cast(syntax: SyntaxNode) -> Option<Self> {
         let res = match syntax.kind() {
             STRUCT => AdtDef::Struct(Struct { syntax }),
-            ENUM_DEF => AdtDef::EnumDef(EnumDef { syntax }),
+            ENUM => AdtDef::Enum(Enum { syntax }),
             UNION => AdtDef::Union(Union { syntax }),
             _ => return None,
         };
@@ -3400,7 +3401,7 @@ impl AstNode for AdtDef {
     fn syntax(&self) -> &SyntaxNode {
         match self {
             AdtDef::Struct(it) => &it.syntax,
-            AdtDef::EnumDef(it) => &it.syntax,
+            AdtDef::Enum(it) => &it.syntax,
             AdtDef::Union(it) => &it.syntax,
         }
     }
@@ -3465,12 +3466,12 @@ impl std::fmt::Display for Attr {
         std::fmt::Display::fmt(self.syntax(), f)
     }
 }
-impl std::fmt::Display for ConstDef {
+impl std::fmt::Display for Const {
     fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         std::fmt::Display::fmt(self.syntax(), f)
     }
 }
-impl std::fmt::Display for EnumDef {
+impl std::fmt::Display for Enum {
     fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         std::fmt::Display::fmt(self.syntax(), f)
     }
@@ -3505,7 +3506,7 @@ impl std::fmt::Display for Module {
         std::fmt::Display::fmt(self.syntax(), f)
     }
 }
-impl std::fmt::Display for StaticDef {
+impl std::fmt::Display for Static {
     fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         std::fmt::Display::fmt(self.syntax(), f)
     }
@@ -3640,12 +3641,12 @@ impl std::fmt::Display for TupleField {
         std::fmt::Display::fmt(self.syntax(), f)
     }
 }
-impl std::fmt::Display for EnumVariantList {
+impl std::fmt::Display for VariantList {
     fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         std::fmt::Display::fmt(self.syntax(), f)
     }
 }
-impl std::fmt::Display for EnumVariant {
+impl std::fmt::Display for Variant {
     fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         std::fmt::Display::fmt(self.syntax(), f)
     }
diff --git a/crates/ra_syntax/src/ast/node_ext.rs b/crates/ra_syntax/src/ast/node_ext.rs
index 2299988ce7..4da1d5c113 100644
--- a/crates/ra_syntax/src/ast/node_ext.rs
+++ b/crates/ra_syntax/src/ast/node_ext.rs
@@ -247,12 +247,12 @@ impl ast::RecordFieldPat {
     }
 }
 
-impl ast::EnumVariant {
-    pub fn parent_enum(&self) -> ast::EnumDef {
+impl ast::Variant {
+    pub fn parent_enum(&self) -> ast::Enum {
         self.syntax()
             .parent()
             .and_then(|it| it.parent())
-            .and_then(ast::EnumDef::cast)
+            .and_then(ast::Enum::cast)
             .expect("EnumVariants are always nested in Enums")
     }
     pub fn kind(&self) -> StructKind {
@@ -479,12 +479,12 @@ impl ast::DocCommentsOwner for ast::Struct {}
 impl ast::DocCommentsOwner for ast::Union {}
 impl ast::DocCommentsOwner for ast::RecordField {}
 impl ast::DocCommentsOwner for ast::TupleField {}
-impl ast::DocCommentsOwner for ast::EnumDef {}
-impl ast::DocCommentsOwner for ast::EnumVariant {}
+impl ast::DocCommentsOwner for ast::Enum {}
+impl ast::DocCommentsOwner for ast::Variant {}
 impl ast::DocCommentsOwner for ast::TraitDef {}
 impl ast::DocCommentsOwner for ast::Module {}
-impl ast::DocCommentsOwner for ast::StaticDef {}
-impl ast::DocCommentsOwner for ast::ConstDef {}
+impl ast::DocCommentsOwner for ast::Static {}
+impl ast::DocCommentsOwner for ast::Const {}
 impl ast::DocCommentsOwner for ast::TypeAlias {}
 impl ast::DocCommentsOwner for ast::ImplDef {}
 impl ast::DocCommentsOwner for ast::MacroCall {}
diff --git a/crates/ra_syntax/src/parsing/text_tree_sink.rs b/crates/ra_syntax/src/parsing/text_tree_sink.rs
index ef260ea592..95581a84b8 100644
--- a/crates/ra_syntax/src/parsing/text_tree_sink.rs
+++ b/crates/ra_syntax/src/parsing/text_tree_sink.rs
@@ -146,8 +146,8 @@ fn n_attached_trivias<'a>(
     trivias: impl Iterator<Item = (SyntaxKind, &'a str)>,
 ) -> usize {
     match kind {
-        MACRO_CALL | CONST_DEF | TYPE_ALIAS | STRUCT | ENUM_DEF | ENUM_VARIANT | FN | TRAIT_DEF
-        | MODULE | RECORD_FIELD | STATIC_DEF => {
+        MACRO_CALL | CONST | TYPE_ALIAS | STRUCT | ENUM | VARIANT | FN | TRAIT_DEF | MODULE
+        | RECORD_FIELD | STATIC => {
             let mut res = 0;
             let mut trivias = trivias.enumerate().peekable();
 
diff --git a/crates/ra_syntax/src/validation.rs b/crates/ra_syntax/src/validation.rs
index 5b4e14676e..a666b18db2 100644
--- a/crates/ra_syntax/src/validation.rs
+++ b/crates/ra_syntax/src/validation.rs
@@ -4,7 +4,7 @@ mod block;
 
 use crate::{
     ast, match_ast, AstNode, SyntaxError,
-    SyntaxKind::{BYTE, BYTE_STRING, CHAR, CONST_DEF, FN, INT_NUMBER, STRING, TYPE_ALIAS},
+    SyntaxKind::{BYTE, BYTE_STRING, CHAR, CONST, FN, INT_NUMBER, STRING, TYPE_ALIAS},
     SyntaxNode, SyntaxToken, TextSize, T,
 };
 use rustc_lexer::unescape::{
@@ -200,7 +200,7 @@ fn validate_visibility(vis: ast::Visibility, errors: &mut Vec<SyntaxError>) {
         None => return,
     };
     match parent.kind() {
-        FN | CONST_DEF | TYPE_ALIAS => (),
+        FN | CONST | TYPE_ALIAS => (),
         _ => return,
     }
 
diff --git a/crates/rust-analyzer/src/handlers.rs b/crates/rust-analyzer/src/handlers.rs
index cb11dffd07..df4969b807 100644
--- a/crates/rust-analyzer/src/handlers.rs
+++ b/crates/rust-analyzer/src/handlers.rs
@@ -926,7 +926,7 @@ pub(crate) fn handle_code_lens(
                         it.kind,
                         SyntaxKind::TRAIT_DEF
                             | SyntaxKind::STRUCT
-                            | SyntaxKind::ENUM_DEF
+                            | SyntaxKind::ENUM
                             | SyntaxKind::UNION
                     )
                 })
diff --git a/crates/rust-analyzer/src/to_proto.rs b/crates/rust-analyzer/src/to_proto.rs
index a09a74c41c..fd51233019 100644
--- a/crates/rust-analyzer/src/to_proto.rs
+++ b/crates/rust-analyzer/src/to_proto.rs
@@ -33,15 +33,15 @@ pub(crate) fn symbol_kind(syntax_kind: SyntaxKind) -> lsp_types::SymbolKind {
     match syntax_kind {
         SyntaxKind::FN => lsp_types::SymbolKind::Function,
         SyntaxKind::STRUCT => lsp_types::SymbolKind::Struct,
-        SyntaxKind::ENUM_DEF => lsp_types::SymbolKind::Enum,
-        SyntaxKind::ENUM_VARIANT => lsp_types::SymbolKind::EnumMember,
+        SyntaxKind::ENUM => lsp_types::SymbolKind::Enum,
+        SyntaxKind::VARIANT => lsp_types::SymbolKind::EnumMember,
         SyntaxKind::TRAIT_DEF => lsp_types::SymbolKind::Interface,
         SyntaxKind::MACRO_CALL => lsp_types::SymbolKind::Function,
         SyntaxKind::MODULE => lsp_types::SymbolKind::Module,
         SyntaxKind::TYPE_ALIAS => lsp_types::SymbolKind::TypeParameter,
         SyntaxKind::RECORD_FIELD => lsp_types::SymbolKind::Field,
-        SyntaxKind::STATIC_DEF => lsp_types::SymbolKind::Constant,
-        SyntaxKind::CONST_DEF => lsp_types::SymbolKind::Constant,
+        SyntaxKind::STATIC => lsp_types::SymbolKind::Constant,
+        SyntaxKind::CONST => lsp_types::SymbolKind::Constant,
         SyntaxKind::IMPL_DEF => lsp_types::SymbolKind::Object,
         _ => lsp_types::SymbolKind::Variable,
     }
diff --git a/xtask/src/ast_src.rs b/xtask/src/ast_src.rs
index e8a90636e6..56e3f4b0a4 100644
--- a/xtask/src/ast_src.rs
+++ b/xtask/src/ast_src.rs
@@ -95,14 +95,14 @@ pub(crate) const KINDS_SRC: KindsSrc = KindsSrc {
         "SOURCE_FILE",
         "STRUCT",
         "UNION",
-        "ENUM_DEF",
+        "ENUM",
         "FN",
         "RET_TYPE",
         "EXTERN_CRATE",
         "MODULE",
         "USE",
-        "STATIC_DEF",
-        "CONST_DEF",
+        "STATIC",
+        "CONST",
         "TRAIT_DEF",
         "IMPL_DEF",
         "TYPE_ALIAS",
@@ -179,12 +179,12 @@ pub(crate) const KINDS_SRC: KindsSrc = KindsSrc {
         "BIN_EXPR",
         "EXTERN_BLOCK",
         "EXTERN_ITEM_LIST",
-        "ENUM_VARIANT",
+        "VARIANT",
         "RECORD_FIELD_LIST",
         "RECORD_FIELD",
         "TUPLE_FIELD_LIST",
         "TUPLE_FIELD",
-        "ENUM_VARIANT_LIST",
+        "VARIANT_LIST",
         "ITEM_LIST",
         "ASSOC_ITEM_LIST",
         "ATTR",
diff --git a/xtask/src/codegen/rust.ungram b/xtask/src/codegen/rust.ungram
index d038c5c5ac..ef7c3e50e2 100644
--- a/xtask/src/codegen/rust.ungram
+++ b/xtask/src/codegen/rust.ungram
@@ -4,15 +4,15 @@ SourceFile =
   Item*
 
 Item =
-  ConstDef
-| EnumDef
+  Const
+| Enum
 | ExternBlock
 | ExternCrate
 | Fn
 | ImplDef
 | MacroCall
 | Module
-| StaticDef
+| Static
 | Struct
 | TraitDef
 | TypeAlias
@@ -98,19 +98,27 @@ FieldList =
   RecordFieldList
 | TupleFieldList
 
+Enum =
+  Attr* Visibility? 'enum' Name GenericParamList? WhereClause?
+  VariantList
+
+VariantList =
+ '{' (Variant (',' Variant)* ','?)? '}'
+
+Variant =
+  Attr* Visibility? Name FieldList ('=' Expr)?
+
 Union =
   Attr* Visibility? 'union' Name GenericParamList? WhereClause?
   RecordFieldList
 
-EnumDef =
-  Attr* Visibility? 'enum' Name GenericParamList? WhereClause?
-  variant_list:EnumVariantList
-
-EnumVariantList =
- '{' variants:EnumVariant* '}'
+Const =
+  Attr* Visibility? 'default'? 'const' (Name | '_') ':' ascribed_type:TypeRef
+  '=' body:Expr ';'
 
-EnumVariant =
-  Attr* Visibility? Name FieldList ('=' Expr)?
+Static =
+  Attr* Visibility? 'static'? 'mut'? Name ':' ascribed_type:TypeRef
+  '=' body:Expr ';'
 
 TraitDef =
   Attr* Visibility? 'unsafe'? 'auto'? 'trait' Name GenericParamList
@@ -120,14 +128,6 @@ TraitDef =
 AssocItemList =
   '{' AssocItem* '}'
 
-ConstDef =
-  Attr* Visibility? 'default'? 'const' Name ':' ascribed_type:TypeRef
-  '=' body:Expr ';'
-
-StaticDef =
-  Attr* Visibility? 'static'? 'mut'? 'static' Name ':' ascribed_type:TypeRef
-  '=' body:Expr ';'
-
 ImplDef =
  Attr* Visibility? 'const'? 'default'? 'unsafe'? 'impl' GenericParamList? '!'? 'for'
  WhereClause?
@@ -454,7 +454,7 @@ MetaItem =
 
 AdtDef =
   Struct
-| EnumDef
+| Enum
 | Union
 
 TypeRef =
@@ -475,11 +475,11 @@ TypeRef =
 AssocItem =
   Fn
 | TypeAlias
-| ConstDef
+| Const
 | MacroCall
 
 ExternItem =
-  Fn | StaticDef
+  Fn | Static
 
 AttrInput =
   Literal


Test patch:
diff --git a/crates/ra_hir_def/src/item_tree/tests.rs b/crates/ra_hir_def/src/item_tree/tests.rs
index db37223dac..e61ce58bcc 100644
--- a/crates/ra_hir_def/src/item_tree/tests.rs
+++ b/crates/ra_hir_def/src/item_tree/tests.rs
@@ -238,7 +238,7 @@ fn smoke() {
             > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("assoc_ty"))] }, input: None }]) }]
             > TypeAlias { name: Name(Text("AssocTy")), visibility: RawVisibilityId("pub(self)"), bounds: [Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("Tr"))] }, generic_args: [Some(GenericArgs { args: [Type(Tuple([]))], has_self_type: false, bindings: [] })] })], generic_params: GenericParamsId(4294967295), type_ref: None, ast_id: FileAstId::<ra_syntax::ast::generated::nodes::TypeAlias>(8) }
             > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("assoc_const"))] }, input: None }]) }]
-            > Const { name: Some(Name(Text("CONST"))), visibility: RawVisibilityId("pub(self)"), type_ref: Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("u8"))] }, generic_args: [None] }), ast_id: FileAstId::<ra_syntax::ast::generated::nodes::ConstDef>(9) }
+            > Const { name: Some(Name(Text("CONST"))), visibility: RawVisibilityId("pub(self)"), type_ref: Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("u8"))] }, generic_args: [None] }), ast_id: FileAstId::<ra_syntax::ast::generated::nodes::Const>(9) }
             > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("assoc_method"))] }, input: None }]) }]
             > Function { name: Name(Text("method")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), has_self_param: true, is_unsafe: false, params: [Reference(Path(Path { type_anchor: None, mod_path: ModPath { kind: Plain, segments: [Name(Text("Self"))] }, generic_args: [None] }), Shared)], is_varargs: false, ret_type: Tuple([]), ast_id: FileAstId::<ra_syntax::ast::generated::nodes::Fn>(10) }
             > #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("assoc_dfl_method"))] }, input: None }]) }]
@@ -250,7 +250,7 @@ fn smoke() {
             #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("struct2"))] }, input: None }]) }]
             Struct { name: Name(Text("Struct2")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(3), fields: Record(IdRange::<ra_hir_def::item_tree::Field>(1..2)), ast_id: FileAstId::<ra_syntax::ast::generated::nodes::Struct>(5), kind: Record }
             #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("en"))] }, input: None }]) }]
-            Enum { name: Name(Text("En")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), variants: IdRange::<ra_hir_def::item_tree::Variant>(0..1), ast_id: FileAstId::<ra_syntax::ast::generated::nodes::EnumDef>(6) }
+            Enum { name: Name(Text("En")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), variants: IdRange::<ra_hir_def::item_tree::Variant>(0..1), ast_id: FileAstId::<ra_syntax::ast::generated::nodes::Enum>(6) }
             #[Attrs { entries: Some([Attr { path: ModPath { kind: Plain, segments: [Name(Text("un"))] }, input: None }]) }]
             Union { name: Name(Text("Un")), visibility: RawVisibilityId("pub(self)"), generic_params: GenericParamsId(4294967295), fields: Record(IdRange::<ra_hir_def::item_tree::Field>(3..4)), ast_id: FileAstId::<ra_syntax::ast::generated::nodes::Union>(7) }
         "##]],
diff --git a/crates/ra_mbe/src/tests.rs b/crates/ra_mbe/src/tests.rs
index 21af06e73a..707e84f42d 100644
--- a/crates/ra_mbe/src/tests.rs
+++ b/crates/ra_mbe/src/tests.rs
@@ -1467,7 +1467,7 @@ macro_rules! quick_error {
         buf [ ]
         queue [ ]
     ) => {
-        quick_error!(ENUM_DEFINITION [enum $name $( #[$meta] )*]
+        quick_error!(ENUMINITION [enum $name $( #[$meta] )*]
             body []
             queue [$(
                 $( #[$imeta] )*
@@ -1489,7 +1489,7 @@ quick_error ! (SORT [enum Wrapped # [derive (Debug)]] items [
 "#,
     );
 
-    assert_eq!(expanded.to_string(), "quick_error ! (ENUM_DEFINITION [enum Wrapped # [derive (Debug)]] body [] queue [=> One : UNIT [] => Two : TUPLE [s : String]]) ;");
+    assert_eq!(expanded.to_string(), "quick_error ! (ENUMINITION [enum Wrapped # [derive (Debug)]] body [] queue [=> One : UNIT [] => Two : TUPLE [s : String]]) ;");
 }
 
 #[test]
diff --git a/crates/ra_syntax/test_data/parser/err/0025_nope.rast b/crates/ra_syntax/test_data/parser/err/0025_nope.rast
index a1258028db..fca6465573 100644
--- a/crates/ra_syntax/test_data/parser/err/0025_nope.rast
+++ b/crates/ra_syntax/test_data/parser/err/0025_nope.rast
@@ -11,21 +11,21 @@ SOURCE_FILE@0..575
     BLOCK_EXPR@10..574
       L_CURLY@10..11 "{"
       WHITESPACE@11..16 "\n    "
-      ENUM_DEF@16..152
+      ENUM@16..152
         ENUM_KW@16..20 "enum"
         WHITESPACE@20..21 " "
         NAME@21..25
           IDENT@21..25 "Test"
         WHITESPACE@25..26 " "
-        ENUM_VARIANT_LIST@26..152
+        VARIANT_LIST@26..152
           L_CURLY@26..27 "{"
           WHITESPACE@27..36 "\n        "
-          ENUM_VARIANT@36..40
+          VARIANT@36..40
             NAME@36..40
               IDENT@36..40 "Var1"
           COMMA@40..41 ","
           WHITESPACE@41..50 "\n        "
-          ENUM_VARIANT@50..62
+          VARIANT@50..62
             NAME@50..54
               IDENT@50..54 "Var2"
             TUPLE_FIELD_LIST@54..62
@@ -39,7 +39,7 @@ SOURCE_FILE@0..575
               R_PAREN@61..62 ")"
           COMMA@62..63 ","
           WHITESPACE@63..72 "\n        "
-          ENUM_VARIANT@72..145
+          VARIANT@72..145
             NAME@72..76
               IDENT@72..76 "Var3"
             WHITESPACE@76..77 " "
@@ -79,32 +79,32 @@ SOURCE_FILE@0..575
           INT_NUMBER@184..185 "1"
         SEMICOLON@185..186 ";"
       WHITESPACE@186..191 "\n    "
-      ENUM_DEF@191..223
+      ENUM@191..223
         ENUM_KW@191..195 "enum"
         WHITESPACE@195..196 " "
         NAME@196..201
           IDENT@196..201 "Test2"
         WHITESPACE@201..202 " "
-        ENUM_VARIANT_LIST@202..223
+        VARIANT_LIST@202..223
           L_CURLY@202..203 "{"
           WHITESPACE@203..212 "\n        "
-          ENUM_VARIANT@212..216
+          VARIANT@212..216
             NAME@212..216
               IDENT@212..216 "Fine"
           COMMA@216..217 ","
           WHITESPACE@217..222 "\n    "
           R_CURLY@222..223 "}"
       WHITESPACE@223..229 "\n\n    "
-      ENUM_DEF@229..300
+      ENUM@229..300
         ENUM_KW@229..233 "enum"
         WHITESPACE@233..234 " "
         NAME@234..239
           IDENT@234..239 "Test3"
         WHITESPACE@239..240 " "
-        ENUM_VARIANT_LIST@240..300
+        VARIANT_LIST@240..300
           L_CURLY@240..241 "{"
           WHITESPACE@241..250 "\n        "
-          ENUM_VARIANT@250..293
+          VARIANT@250..293
             NAME@250..259
               IDENT@250..259 "StillFine"
             WHITESPACE@259..260 " "
@@ -132,7 +132,7 @@ SOURCE_FILE@0..575
         BLOCK_EXPR@306..459
           L_CURLY@306..307 "{"
           WHITESPACE@307..316 "\n        "
-          ENUM_DEF@316..453
+          ENUM@316..453
             COMMENT@316..329 "// fail again"
             WHITESPACE@329..338 "\n        "
             ENUM_KW@338..342 "enum"
@@ -140,10 +140,10 @@ SOURCE_FILE@0..575
             NAME@343..348
               IDENT@343..348 "Test4"
             WHITESPACE@348..349 " "
-            ENUM_VARIANT_LIST@349..453
+            VARIANT_LIST@349..453
               L_CURLY@349..350 "{"
               WHITESPACE@350..363 "\n            "
-              ENUM_VARIANT@363..372
+              VARIANT@363..372
                 NAME@363..367
                   IDENT@363..367 "Nope"
                 TUPLE_FIELD_LIST@367..372
diff --git a/crates/ra_syntax/test_data/parser/err/0037_visibility_in_traits.rast b/crates/ra_syntax/test_data/parser/err/0037_visibility_in_traits.rast
index c0ba4fba91..b1400aa5f7 100644
--- a/crates/ra_syntax/test_data/parser/err/0037_visibility_in_traits.rast
+++ b/crates/ra_syntax/test_data/parser/err/0037_visibility_in_traits.rast
@@ -65,7 +65,7 @@ SOURCE_FILE@0..118
           R_PAREN@79..80 ")"
         SEMICOLON@80..81 ";"
       WHITESPACE@81..86 "\n    "
-      CONST_DEF@86..115
+      CONST@86..115
         VISIBILITY@86..96
           PUB_KW@86..89 "pub"
           L_PAREN@89..90 "("
diff --git a/crates/ra_syntax/test_data/parser/err/0043_default_const.rast b/crates/ra_syntax/test_data/parser/err/0043_default_const.rast
index 6ca1a48700..f041fa6f79 100644
--- a/crates/ra_syntax/test_data/parser/err/0043_default_const.rast
+++ b/crates/ra_syntax/test_data/parser/err/0043_default_const.rast
@@ -14,7 +14,7 @@ SOURCE_FILE@0..39
             NAME_REF@12..19
               IDENT@12..19 "default"
       WHITESPACE@19..20 " "
-      CONST_DEF@20..36
+      CONST@20..36
         CONST_KW@20..25 "const"
         WHITESPACE@25..26 " "
         NAME@26..27
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0010_wrong_order_fns.rast b/crates/ra_syntax/test_data/parser/inline/err/0010_wrong_order_fns.rast
index d2a18330fa..a6e6552a99 100644
--- a/crates/ra_syntax/test_data/parser/inline/err/0010_wrong_order_fns.rast
+++ b/crates/ra_syntax/test_data/parser/inline/err/0010_wrong_order_fns.rast
@@ -17,7 +17,7 @@ SOURCE_FILE@0..50
       L_CURLY@22..23 "{"
       R_CURLY@23..24 "}"
   WHITESPACE@24..25 "\n"
-  CONST_DEF@25..46
+  CONST@25..46
     UNSAFE_KW@25..31 "unsafe"
     WHITESPACE@31..32 " "
     CONST_KW@32..37 "const"
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0013_static_underscore.rast b/crates/ra_syntax/test_data/parser/inline/err/0013_static_underscore.rast
index ebcc26e0d6..8d761b9074 100644
--- a/crates/ra_syntax/test_data/parser/inline/err/0013_static_underscore.rast
+++ b/crates/ra_syntax/test_data/parser/inline/err/0013_static_underscore.rast
@@ -1,5 +1,5 @@
 SOURCE_FILE@0..19
-  STATIC_DEF@0..18
+  STATIC@0..18
     STATIC_KW@0..6 "static"
     WHITESPACE@6..7 " "
     ERROR@7..8
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0001_trait_item_list.rast b/crates/ra_syntax/test_data/parser/inline/ok/0001_trait_item_list.rast
index a62ce23e6a..955e00dde3 100644
--- a/crates/ra_syntax/test_data/parser/inline/ok/0001_trait_item_list.rast
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0001_trait_item_list.rast
@@ -27,7 +27,7 @@ SOURCE_FILE@0..83
                     IDENT@21..26 "Clone"
         SEMICOLON@26..27 ";"
       WHITESPACE@27..32 "\n    "
-      CONST_DEF@32..45
+      CONST@32..45
         CONST_KW@32..37 "const"
         WHITESPACE@37..38 " "
         NAME@38..39
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0021_impl_item_list.rast b/crates/ra_syntax/test_data/parser/inline/ok/0021_impl_item_list.rast
index 3ae870e17a..52181ca0c3 100644
--- a/crates/ra_syntax/test_data/parser/inline/ok/0021_impl_item_list.rast
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0021_impl_item_list.rast
@@ -26,7 +26,7 @@ SOURCE_FILE@0..89
                 IDENT@22..25 "i32"
         SEMICOLON@25..26 ";"
       WHITESPACE@26..31 "\n    "
-      CONST_DEF@31..49
+      CONST@31..49
         CONST_KW@31..36 "const"
         WHITESPACE@36..37 " "
         NAME@37..38
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0118_impl_inner_attributes.rast b/crates/ra_syntax/test_data/parser/inline/ok/0118_impl_inner_attributes.rast
index ea54347fc4..f2561abd69 100644
--- a/crates/ra_syntax/test_data/parser/inline/ok/0118_impl_inner_attributes.rast
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0118_impl_inner_attributes.rast
@@ -1,10 +1,10 @@
 SOURCE_FILE@0..94
-  ENUM_DEF@0..8
+  ENUM@0..8
     ENUM_KW@0..4 "enum"
     WHITESPACE@4..5 " "
     NAME@5..6
       IDENT@5..6 "F"
-    ENUM_VARIANT_LIST@6..8
+    VARIANT_LIST@6..8
       L_CURLY@6..7 "{"
       R_CURLY@7..8 "}"
   WHITESPACE@8..9 "\n"
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0134_nocontentexpr_after_item.rast b/crates/ra_syntax/test_data/parser/inline/ok/0134_nocontentexpr_after_item.rast
index 280f947ce0..429a0506e1 100644
--- a/crates/ra_syntax/test_data/parser/inline/ok/0134_nocontentexpr_after_item.rast
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0134_nocontentexpr_after_item.rast
@@ -11,21 +11,21 @@ SOURCE_FILE@0..111
     BLOCK_EXPR@21..110
       L_CURLY@21..22 "{"
       WHITESPACE@22..27 "\n    "
-      ENUM_DEF@27..75
+      ENUM@27..75
         ENUM_KW@27..31 "enum"
         WHITESPACE@31..32 " "
         NAME@32..41
           IDENT@32..41 "LocalEnum"
         WHITESPACE@41..42 " "
-        ENUM_VARIANT_LIST@42..75
+        VARIANT_LIST@42..75
           L_CURLY@42..43 "{"
           WHITESPACE@43..52 "\n        "
-          ENUM_VARIANT@52..55
+          VARIANT@52..55
             NAME@52..55
               IDENT@52..55 "One"
           COMMA@55..56 ","
           WHITESPACE@56..65 "\n        "
-          ENUM_VARIANT@65..68
+          VARIANT@65..68
             NAME@65..68
               IDENT@65..68 "Two"
           COMMA@68..69 ","
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0150_array_attrs.rast b/crates/ra_syntax/test_data/parser/inline/ok/0150_array_attrs.rast
index 3c00a26477..0c35bf2b7c 100644
--- a/crates/ra_syntax/test_data/parser/inline/ok/0150_array_attrs.rast
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0150_array_attrs.rast
@@ -1,5 +1,5 @@
 SOURCE_FILE@0..40
-  CONST_DEF@0..39
+  CONST@0..39
     CONST_KW@0..5 "const"
     WHITESPACE@5..6 " "
     NAME@6..7
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0157_variant_discriminant.rast b/crates/ra_syntax/test_data/parser/inline/ok/0157_variant_discriminant.rast
index 289fdfd6db..a2e05eb2e2 100644
--- a/crates/ra_syntax/test_data/parser/inline/ok/0157_variant_discriminant.rast
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0157_variant_discriminant.rast
@@ -1,14 +1,14 @@
 SOURCE_FILE@0..23
-  ENUM_DEF@0..22
+  ENUM@0..22
     ENUM_KW@0..4 "enum"
     WHITESPACE@4..5 " "
     NAME@5..6
       IDENT@5..6 "E"
     WHITESPACE@6..7 " "
-    ENUM_VARIANT_LIST@7..22
+    VARIANT_LIST@7..22
       L_CURLY@7..8 "{"
       WHITESPACE@8..9 " "
-      ENUM_VARIANT@9..20
+      VARIANT@9..20
         NAME@9..10
           IDENT@9..10 "X"
         TUPLE_FIELD_LIST@10..15
diff --git a/crates/ra_syntax/test_data/parser/ok/0019_enums.rast b/crates/ra_syntax/test_data/parser/ok/0019_enums.rast
index 1a32d88fdc..c3df008146 100644
--- a/crates/ra_syntax/test_data/parser/ok/0019_enums.rast
+++ b/crates/ra_syntax/test_data/parser/ok/0019_enums.rast
@@ -1,16 +1,16 @@
 SOURCE_FILE@0..182
-  ENUM_DEF@0..11
+  ENUM@0..11
     ENUM_KW@0..4 "enum"
     WHITESPACE@4..5 " "
     NAME@5..7
       IDENT@5..7 "E1"
     WHITESPACE@7..8 " "
-    ENUM_VARIANT_LIST@8..11
+    VARIANT_LIST@8..11
       L_CURLY@8..9 "{"
       WHITESPACE@9..10 "\n"
       R_CURLY@10..11 "}"
   WHITESPACE@11..13 "\n\n"
-  ENUM_DEF@13..27
+  ENUM@13..27
     ENUM_KW@13..17 "enum"
     WHITESPACE@17..18 " "
     NAME@18..20
@@ -22,57 +22,57 @@ SOURCE_FILE@0..182
           IDENT@21..22 "T"
       R_ANGLE@22..23 ">"
     WHITESPACE@23..24 " "
-    ENUM_VARIANT_LIST@24..27
+    VARIANT_LIST@24..27
       L_CURLY@24..25 "{"
       WHITESPACE@25..26 "\n"
       R_CURLY@26..27 "}"
   WHITESPACE@27..29 "\n\n"
-  ENUM_DEF@29..46
+  ENUM@29..46
     ENUM_KW@29..33 "enum"
     WHITESPACE@33..34 " "
     NAME@34..36
       IDENT@34..36 "E3"
     WHITESPACE@36..37 " "
-    ENUM_VARIANT_LIST@37..46
+    VARIANT_LIST@37..46
       L_CURLY@37..38 "{"
       WHITESPACE@38..43 "\n    "
-      ENUM_VARIANT@43..44
+      VARIANT@43..44
         NAME@43..44
           IDENT@43..44 "X"
       WHITESPACE@44..45 "\n"
       R_CURLY@45..46 "}"
   WHITESPACE@46..48 "\n\n"
-  ENUM_DEF@48..66
+  ENUM@48..66
     ENUM_KW@48..52 "enum"
     WHITESPACE@52..53 " "
     NAME@53..55
       IDENT@53..55 "E4"
     WHITESPACE@55..56 " "
-    ENUM_VARIANT_LIST@56..66
+    VARIANT_LIST@56..66
       L_CURLY@56..57 "{"
       WHITESPACE@57..62 "\n    "
-      ENUM_VARIANT@62..63
+      VARIANT@62..63
         NAME@62..63
           IDENT@62..63 "X"
       COMMA@63..64 ","
       WHITESPACE@64..65 "\n"
       R_CURLY@65..66 "}"
   WHITESPACE@66..68 "\n\n"
-  ENUM_DEF@68..181
+  ENUM@68..181
     ENUM_KW@68..72 "enum"
     WHITESPACE@72..73 " "
     NAME@73..75
       IDENT@73..75 "E5"
     WHITESPACE@75..76 " "
-    ENUM_VARIANT_LIST@76..181
+    VARIANT_LIST@76..181
       L_CURLY@76..77 "{"
       WHITESPACE@77..82 "\n    "
-      ENUM_VARIANT@82..83
+      VARIANT@82..83
         NAME@82..83
           IDENT@82..83 "A"
       COMMA@83..84 ","
       WHITESPACE@84..89 "\n    "
-      ENUM_VARIANT@89..95
+      VARIANT@89..95
         NAME@89..90
           IDENT@89..90 "B"
         WHITESPACE@90..91 " "
@@ -82,7 +82,7 @@ SOURCE_FILE@0..182
           INT_NUMBER@93..95 "92"
       COMMA@95..96 ","
       WHITESPACE@96..101 "\n    "
-      ENUM_VARIANT@101..146
+      VARIANT@101..146
         NAME@101..102
           IDENT@101..102 "C"
         WHITESPACE@102..103 " "
@@ -119,7 +119,7 @@ SOURCE_FILE@0..182
           R_CURLY@145..146 "}"
       COMMA@146..147 ","
       WHITESPACE@147..152 "\n    "
-      ENUM_VARIANT@152..156
+      VARIANT@152..156
         NAME@152..153
           IDENT@152..153 "F"
         WHITESPACE@153..154 " "
@@ -128,7 +128,7 @@ SOURCE_FILE@0..182
           R_CURLY@155..156 "}"
       COMMA@156..157 ","
       WHITESPACE@157..162 "\n    "
-      ENUM_VARIANT@162..169
+      VARIANT@162..169
         NAME@162..163
           IDENT@162..163 "D"
         TUPLE_FIELD_LIST@163..169
@@ -143,7 +143,7 @@ SOURCE_FILE@0..182
           R_PAREN@168..169 ")"
       COMMA@169..170 ","
       WHITESPACE@170..175 "\n    "
-      ENUM_VARIANT@175..178
+      VARIANT@175..178
         NAME@175..176
           IDENT@175..176 "E"
         TUPLE_FIELD_LIST@176..178
diff --git a/crates/ra_syntax/test_data/parser/ok/0023_static_items.rast b/crates/ra_syntax/test_data/parser/ok/0023_static_items.rast
index 97d90dc756..9374cf5e96 100644
--- a/crates/ra_syntax/test_data/parser/ok/0023_static_items.rast
+++ b/crates/ra_syntax/test_data/parser/ok/0023_static_items.rast
@@ -1,5 +1,5 @@
 SOURCE_FILE@0..47
-  STATIC_DEF@0..20
+  STATIC@0..20
     STATIC_KW@0..6 "static"
     WHITESPACE@6..7 " "
     NAME@7..10
@@ -18,7 +18,7 @@ SOURCE_FILE@0..47
       INT_NUMBER@18..19 "1"
     SEMICOLON@19..20 ";"
   WHITESPACE@20..21 "\n"
-  STATIC_DEF@21..46
+  STATIC@21..46
     STATIC_KW@21..27 "static"
     WHITESPACE@27..28 " "
     MUT_KW@28..31 "mut"
diff --git a/crates/ra_syntax/test_data/parser/ok/0024_const_item.rast b/crates/ra_syntax/test_data/parser/ok/0024_const_item.rast
index d241f034c7..dd1b9c9a0a 100644
--- a/crates/ra_syntax/test_data/parser/ok/0024_const_item.rast
+++ b/crates/ra_syntax/test_data/parser/ok/0024_const_item.rast
@@ -1,5 +1,5 @@
 SOURCE_FILE@0..64
-  CONST_DEF@0..17
+  CONST@0..17
     CONST_KW@0..5 "const"
     WHITESPACE@5..6 " "
     UNDERSCORE@6..7 "_"
@@ -17,7 +17,7 @@ SOURCE_FILE@0..64
       INT_NUMBER@15..16 "0"
     SEMICOLON@16..17 ";"
   WHITESPACE@17..18 "\n"
-  CONST_DEF@18..38
+  CONST@18..38
     CONST_KW@18..23 "const"
     WHITESPACE@23..24 " "
     NAME@24..27
@@ -36,7 +36,7 @@ SOURCE_FILE@0..64
       INT_NUMBER@35..37 "92"
     SEMICOLON@37..38 ";"
   WHITESPACE@38..39 "\n"
-  CONST_DEF@39..63
+  CONST@39..63
     CONST_KW@39..44 "const"
     WHITESPACE@44..45 " "
     MUT_KW@45..48 "mut"
diff --git a/crates/ra_syntax/test_data/parser/ok/0047_minus_in_inner_pattern.rast b/crates/ra_syntax/test_data/parser/ok/0047_minus_in_inner_pattern.rast
index fcf605ec82..7a54fa1132 100644
--- a/crates/ra_syntax/test_data/parser/ok/0047_minus_in_inner_pattern.rast
+++ b/crates/ra_syntax/test_data/parser/ok/0047_minus_in_inner_pattern.rast
@@ -256,16 +256,16 @@ SOURCE_FILE@0..395
       WHITESPACE@339..340 "\n"
       R_CURLY@340..341 "}"
   WHITESPACE@341..343 "\n\n"
-  ENUM_DEF@343..367
+  ENUM@343..367
     ENUM_KW@343..347 "enum"
     WHITESPACE@347..348 " "
     NAME@348..349
       IDENT@348..349 "A"
     WHITESPACE@349..350 " "
-    ENUM_VARIANT_LIST@350..367
+    VARIANT_LIST@350..367
       L_CURLY@350..351 "{"
       WHITESPACE@351..356 "\n    "
-      ENUM_VARIANT@356..365
+      VARIANT@356..365
         NAME@356..357
           IDENT@356..357 "B"
         TUPLE_FIELD_LIST@357..365
diff --git a/crates/ra_syntax/test_data/parser/ok/0066_default_const.rast b/crates/ra_syntax/test_data/parser/ok/0066_default_const.rast
index 584b2faf10..485efe20cf 100644
--- a/crates/ra_syntax/test_data/parser/ok/0066_default_const.rast
+++ b/crates/ra_syntax/test_data/parser/ok/0066_default_const.rast
@@ -19,7 +19,7 @@ SOURCE_FILE@0..46
     ASSOC_ITEM_LIST@15..45
       L_CURLY@15..16 "{"
       WHITESPACE@16..19 "\n  "
-      CONST_DEF@19..43
+      CONST@19..43
         DEFAULT_KW@19..26 "default"
         WHITESPACE@26..27 " "
         CONST_KW@27..32 "const"