Repository: rust-analyzer/rust-analyzer
Pull request #5629 (2020-07-31 16:50:27)

Finalize Path grammar
bors r+
🤖


Patch:
diff --git a/crates/ra_assists/src/ast_transform.rs b/crates/ra_assists/src/ast_transform.rs
index 3265bd4069..0a7be87a0c 100644
--- a/crates/ra_assists/src/ast_transform.rs
+++ b/crates/ra_assists/src/ast_transform.rs
@@ -79,19 +79,25 @@ impl<'a> SubstituteTypeParams<'a> {
         };
 
         // FIXME: It would probably be nicer if we could get this via HIR (i.e. get the
-        // trait ref, and then go from the types in the substs back to the syntax)
+        // trait ref, and then go from the types in the substs back to the syntax).
         fn get_syntactic_substs(impl_def: ast::Impl) -> Option<Vec<ast::Type>> {
             let target_trait = impl_def.target_trait()?;
             let path_type = match target_trait {
                 ast::Type::PathType(path) => path,
                 _ => return None,
             };
-            let type_arg_list = path_type.path()?.segment()?.type_arg_list()?;
+            let generic_arg_list = path_type.path()?.segment()?.generic_arg_list()?;
+
             let mut result = Vec::new();
-            for type_arg in type_arg_list.type_args() {
-                let type_arg: ast::TypeArg = type_arg;
-                result.push(type_arg.ty()?);
+            for generic_arg in generic_arg_list.generic_args() {
+                match generic_arg {
+                    ast::GenericArg::TypeArg(type_arg) => result.push(type_arg.ty()?),
+                    ast::GenericArg::AssocTypeArg(_)
+                    | ast::GenericArg::LifetimeArg(_)
+                    | ast::GenericArg::ConstArg(_) => (),
+                }
             }
+
             Some(result)
         }
     }
@@ -157,7 +163,7 @@ impl<'a> QualifyPaths<'a> {
 
                 let type_args = p
                     .segment()
-                    .and_then(|s| s.type_arg_list())
+                    .and_then(|s| s.generic_arg_list())
                     .map(|arg_list| apply(self, arg_list));
                 if let Some(type_args) = type_args {
                     let last_segment = path.segment().unwrap();
diff --git a/crates/ra_hir_def/src/body/lower.rs b/crates/ra_hir_def/src/body/lower.rs
index 0cacc63efb..6bedc6b564 100644
--- a/crates/ra_hir_def/src/body/lower.rs
+++ b/crates/ra_hir_def/src/body/lower.rs
@@ -337,7 +337,7 @@ impl ExprCollector<'_> {
                 };
                 let method_name = e.name_ref().map(|nr| nr.as_name()).unwrap_or_else(Name::missing);
                 let generic_args =
-                    e.type_arg_list().and_then(|it| GenericArgs::from_ast(&self.ctx(), it));
+                    e.generic_arg_list().and_then(|it| GenericArgs::from_ast(&self.ctx(), it));
                 self.alloc_expr(
                     Expr::MethodCall { receiver, method_name, args, generic_args },
                     syntax_ptr,
diff --git a/crates/ra_hir_def/src/path.rs b/crates/ra_hir_def/src/path.rs
index 68b9f89c37..cc1726e9e0 100644
--- a/crates/ra_hir_def/src/path.rs
+++ b/crates/ra_hir_def/src/path.rs
@@ -258,7 +258,7 @@ impl<'a> PathSegments<'a> {
 }
 
 impl GenericArgs {
-    pub(crate) fn from_ast(lower_ctx: &LowerCtx, node: ast::TypeArgList) -> Option<GenericArgs> {
+    pub(crate) fn from_ast(lower_ctx: &LowerCtx, node: ast::GenericArgList) -> Option<GenericArgs> {
         lower::lower_generic_args(lower_ctx, node)
     }
 
diff --git a/crates/ra_hir_def/src/path/lower.rs b/crates/ra_hir_def/src/path/lower.rs
index 257f9a033c..d09fc66e4d 100644
--- a/crates/ra_hir_def/src/path/lower.rs
+++ b/crates/ra_hir_def/src/path/lower.rs
@@ -41,7 +41,7 @@ pub(super) fn lower_path(mut path: ast::Path, hygiene: &Hygiene) -> Option<Path>
                 match hygiene.name_ref_to_name(name_ref) {
                     Either::Left(name) => {
                         let args = segment
-                            .type_arg_list()
+                            .generic_arg_list()
                             .and_then(|it| lower_generic_args(&ctx, it))
                             .or_else(|| {
                                 lower_generic_args_from_fn_path(
@@ -148,33 +148,37 @@ pub(super) fn lower_path(mut path: ast::Path, hygiene: &Hygiene) -> Option<Path>
 
 pub(super) fn lower_generic_args(
     lower_ctx: &LowerCtx,
-    node: ast::TypeArgList,
+    node: ast::GenericArgList,
 ) -> Option<GenericArgs> {
     let mut args = Vec::new();
-    for type_arg in node.type_args() {
-        let type_ref = TypeRef::from_ast_opt(lower_ctx, type_arg.ty());
-        args.push(GenericArg::Type(type_ref));
-    }
-    // lifetimes ignored for now
     let mut bindings = Vec::new();
-    for assoc_type_arg in node.assoc_type_args() {
-        let assoc_type_arg: ast::AssocTypeArg = assoc_type_arg;
-        if let Some(name_ref) = assoc_type_arg.name_ref() {
-            let name = name_ref.as_name();
-            let type_ref = assoc_type_arg.ty().map(|it| TypeRef::from_ast(lower_ctx, it));
-            let bounds = if let Some(l) = assoc_type_arg.type_bound_list() {
-                l.bounds().map(|it| TypeBound::from_ast(lower_ctx, it)).collect()
-            } else {
-                Vec::new()
-            };
-            bindings.push(AssociatedTypeBinding { name, type_ref, bounds });
+    for generic_arg in node.generic_args() {
+        match generic_arg {
+            ast::GenericArg::TypeArg(type_arg) => {
+                let type_ref = TypeRef::from_ast_opt(lower_ctx, type_arg.ty());
+                args.push(GenericArg::Type(type_ref));
+            }
+            ast::GenericArg::AssocTypeArg(assoc_type_arg) => {
+                if let Some(name_ref) = assoc_type_arg.name_ref() {
+                    let name = name_ref.as_name();
+                    let type_ref = assoc_type_arg.ty().map(|it| TypeRef::from_ast(lower_ctx, it));
+                    let bounds = if let Some(l) = assoc_type_arg.type_bound_list() {
+                        l.bounds().map(|it| TypeBound::from_ast(lower_ctx, it)).collect()
+                    } else {
+                        Vec::new()
+                    };
+                    bindings.push(AssociatedTypeBinding { name, type_ref, bounds });
+                }
+            }
+            // Lifetimes and constants are ignored for now.
+            ast::GenericArg::LifetimeArg(_) | ast::GenericArg::ConstArg(_) => (),
         }
     }
+
     if args.is_empty() && bindings.is_empty() {
-        None
-    } else {
-        Some(GenericArgs { args, has_self_type: false, bindings })
+        return None;
     }
+    Some(GenericArgs { args, has_self_type: false, bindings })
 }
 
 /// Collect `GenericArgs` from the parts of a fn-like path, i.e. `Fn(X, Y)
diff --git a/crates/ra_ide/src/completion/completion_context.rs b/crates/ra_ide/src/completion/completion_context.rs
index 2113abbb22..2a5f3c3d20 100644
--- a/crates/ra_ide/src/completion/completion_context.rs
+++ b/crates/ra_ide/src/completion/completion_context.rs
@@ -377,7 +377,7 @@ impl<'a> CompletionContext<'a> {
                 path.syntax().parent().and_then(ast::TupleStructPat::cast).is_some();
 
             self.is_path_type = path.syntax().parent().and_then(ast::PathType::cast).is_some();
-            self.has_type_args = segment.type_arg_list().is_some();
+            self.has_type_args = segment.generic_arg_list().is_some();
 
             #[allow(deprecated)]
             if let Some(path) = hir::Path::from_ast(path.clone()) {
diff --git a/crates/ra_ide/src/extend_selection.rs b/crates/ra_ide/src/extend_selection.rs
index fc81b48cce..319fd500d9 100644
--- a/crates/ra_ide/src/extend_selection.rs
+++ b/crates/ra_ide/src/extend_selection.rs
@@ -45,7 +45,7 @@ fn try_extend_selection(
         VARIANT_LIST,
         USE_TREE_LIST,
         GENERIC_PARAM_LIST,
-        TYPE_ARG_LIST,
+        GENERIC_ARG_LIST,
         TYPE_BOUND_LIST,
         PARAM_LIST,
         ARG_LIST,
diff --git a/crates/ra_parser/src/grammar/type_args.rs b/crates/ra_parser/src/grammar/type_args.rs
index 2d61f9d808..aef7cd6fbb 100644
--- a/crates/ra_parser/src/grammar/type_args.rs
+++ b/crates/ra_parser/src/grammar/type_args.rs
@@ -22,7 +22,7 @@ pub(super) fn opt_type_arg_list(p: &mut Parser, colon_colon_required: bool) {
         }
     }
     p.expect(T![>]);
-    m.complete(p, TYPE_ARG_LIST);
+    m.complete(p, GENERIC_ARG_LIST);
 }
 
 // test type_arg
@@ -52,7 +52,7 @@ fn type_arg(p: &mut Parser) {
             m.complete(p, CONST_ARG);
         }
         k if k.is_literal() => {
-            p.bump(k);
+            expressions::literal(p);
             m.complete(p, CONST_ARG);
         }
         _ => {
diff --git a/crates/ra_parser/src/syntax_kind/generated.rs b/crates/ra_parser/src/syntax_kind/generated.rs
index 2830c0d74b..c3670fb62c 100644
--- a/crates/ra_parser/src/syntax_kind/generated.rs
+++ b/crates/ra_parser/src/syntax_kind/generated.rs
@@ -235,7 +235,7 @@ pub enum SyntaxKind {
     LIFETIME_PARAM,
     TYPE_PARAM,
     CONST_PARAM,
-    TYPE_ARG_LIST,
+    GENERIC_ARG_LIST,
     LIFETIME_ARG,
     TYPE_ARG,
     ASSOC_TYPE_ARG,
diff --git a/crates/ra_ssr/src/matching.rs b/crates/ra_ssr/src/matching.rs
index 74e15c6317..0f72fea691 100644
--- a/crates/ra_ssr/src/matching.rs
+++ b/crates/ra_ssr/src/matching.rs
@@ -348,8 +348,8 @@ impl<'db, 'sema> Matcher<'db, 'sema> {
                 // separately via comparing what the path resolves to below.
                 self.attempt_match_opt(
                     phase,
-                    pattern_segment.type_arg_list(),
-                    code_segment.type_arg_list(),
+                    pattern_segment.generic_arg_list(),
+                    code_segment.generic_arg_list(),
                 )?;
                 self.attempt_match_opt(
                     phase,
diff --git a/crates/ra_ssr/src/resolving.rs b/crates/ra_ssr/src/resolving.rs
index 78d4565467..c2fd3b9050 100644
--- a/crates/ra_ssr/src/resolving.rs
+++ b/crates/ra_ssr/src/resolving.rs
@@ -217,7 +217,7 @@ fn pick_node_for_resolution(node: SyntaxNode) -> SyntaxNode {
 fn path_contains_type_arguments(path: Option<ast::Path>) -> bool {
     if let Some(path) = path {
         if let Some(segment) = path.segment() {
-            if segment.type_arg_list().is_some() {
+            if segment.generic_arg_list().is_some() {
                 mark::hit!(type_arguments_within_path);
                 return true;
             }
diff --git a/crates/ra_syntax/src/ast/edit.rs b/crates/ra_syntax/src/ast/edit.rs
index 8d3e42f256..04746ef8f4 100644
--- a/crates/ra_syntax/src/ast/edit.rs
+++ b/crates/ra_syntax/src/ast/edit.rs
@@ -237,17 +237,17 @@ impl ast::Path {
 
 impl ast::PathSegment {
     #[must_use]
-    pub fn with_type_args(&self, type_args: ast::TypeArgList) -> ast::PathSegment {
+    pub fn with_type_args(&self, type_args: ast::GenericArgList) -> ast::PathSegment {
         self._with_type_args(type_args, false)
     }
 
     #[must_use]
-    pub fn with_turbo_fish(&self, type_args: ast::TypeArgList) -> ast::PathSegment {
+    pub fn with_turbo_fish(&self, type_args: ast::GenericArgList) -> ast::PathSegment {
         self._with_type_args(type_args, true)
     }
 
-    fn _with_type_args(&self, type_args: ast::TypeArgList, turbo: bool) -> ast::PathSegment {
-        if let Some(old) = self.type_arg_list() {
+    fn _with_type_args(&self, type_args: ast::GenericArgList, turbo: bool) -> ast::PathSegment {
+        if let Some(old) = self.generic_arg_list() {
             return self.replace_children(
                 single_node(old.syntax().clone()),
                 iter::once(type_args.syntax().clone().into()),
diff --git a/crates/ra_syntax/src/ast/generated/nodes.rs b/crates/ra_syntax/src/ast/generated/nodes.rs
index e049548c99..c25fa7d5f9 100644
--- a/crates/ra_syntax/src/ast/generated/nodes.rs
+++ b/crates/ra_syntax/src/ast/generated/nodes.rs
@@ -6,6 +6,116 @@ use crate::{
     SyntaxNode, SyntaxToken, T,
 };
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
+pub struct Path {
+    pub(crate) syntax: SyntaxNode,
+}
+impl Path {
+    pub fn qualifier(&self) -> Option<Path> { support::child(&self.syntax) }
+    pub fn coloncolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![::]) }
+    pub fn segment(&self) -> Option<PathSegment> { support::child(&self.syntax) }
+}
+#[derive(Debug, Clone, PartialEq, Eq, Hash)]
+pub struct PathSegment {
+    pub(crate) syntax: SyntaxNode,
+}
+impl PathSegment {
+    pub fn crate_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![crate]) }
+    pub fn self_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![self]) }
+    pub fn super_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![super]) }
+    pub fn coloncolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![::]) }
+    pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) }
+    pub fn generic_arg_list(&self) -> Option<GenericArgList> { support::child(&self.syntax) }
+    pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) }
+    pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) }
+    pub fn l_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![<]) }
+    pub fn path_type(&self) -> Option<PathType> { support::child(&self.syntax) }
+    pub fn as_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![as]) }
+    pub fn r_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![>]) }
+}
+#[derive(Debug, Clone, PartialEq, Eq, Hash)]
+pub struct NameRef {
+    pub(crate) syntax: SyntaxNode,
+}
+impl NameRef {
+    pub fn ident_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![ident]) }
+}
+#[derive(Debug, Clone, PartialEq, Eq, Hash)]
+pub struct GenericArgList {
+    pub(crate) syntax: SyntaxNode,
+}
+impl GenericArgList {
+    pub fn coloncolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![::]) }
+    pub fn l_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![<]) }
+    pub fn generic_args(&self) -> AstChildren<GenericArg> { support::children(&self.syntax) }
+    pub fn r_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![>]) }
+}
+#[derive(Debug, Clone, PartialEq, Eq, Hash)]
+pub struct ParamList {
+    pub(crate) syntax: SyntaxNode,
+}
+impl ParamList {
+    pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
+    pub fn self_param(&self) -> Option<SelfParam> { support::child(&self.syntax) }
+    pub fn comma_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![,]) }
+    pub fn params(&self) -> AstChildren<Param> { support::children(&self.syntax) }
+    pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
+}
+#[derive(Debug, Clone, PartialEq, Eq, Hash)]
+pub struct RetType {
+    pub(crate) syntax: SyntaxNode,
+}
+impl RetType {
+    pub fn thin_arrow_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![->]) }
+    pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
+}
+#[derive(Debug, Clone, PartialEq, Eq, Hash)]
+pub struct PathType {
+    pub(crate) syntax: SyntaxNode,
+}
+impl PathType {
+    pub fn path(&self) -> Option<Path> { support::child(&self.syntax) }
+}
+#[derive(Debug, Clone, PartialEq, Eq, Hash)]
+pub struct TypeArg {
+    pub(crate) syntax: SyntaxNode,
+}
+impl TypeArg {
+    pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
+}
+#[derive(Debug, Clone, PartialEq, Eq, Hash)]
+pub struct AssocTypeArg {
+    pub(crate) syntax: SyntaxNode,
+}
+impl ast::TypeBoundsOwner for AssocTypeArg {}
+impl AssocTypeArg {
+    pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) }
+    pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
+    pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
+}
+#[derive(Debug, Clone, PartialEq, Eq, Hash)]
+pub struct LifetimeArg {
+    pub(crate) syntax: SyntaxNode,
+}
+impl LifetimeArg {
+    pub fn lifetime_token(&self) -> Option<SyntaxToken> {
+        support::token(&self.syntax, T![lifetime])
+    }
+}
+#[derive(Debug, Clone, PartialEq, Eq, Hash)]
+pub struct ConstArg {
+    pub(crate) syntax: SyntaxNode,
+}
+impl ConstArg {
+    pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
+}
+#[derive(Debug, Clone, PartialEq, Eq, Hash)]
+pub struct TypeBoundList {
+    pub(crate) syntax: SyntaxNode,
+}
+impl TypeBoundList {
+    pub fn bounds(&self) -> AstChildren<TypeBound> { support::children(&self.syntax) }
+}
+#[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct SourceFile {
     pub(crate) syntax: SyntaxNode,
 }
@@ -256,13 +366,6 @@ impl ItemList {
     pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
-pub struct NameRef {
-    pub(crate) syntax: SyntaxNode,
-}
-impl NameRef {
-    pub fn ident_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![ident]) }
-}
-#[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct Rename {
     pub(crate) syntax: SyntaxNode,
 }
@@ -283,15 +386,6 @@ impl UseTree {
     pub fn rename(&self) -> Option<Rename> { support::child(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
-pub struct Path {
-    pub(crate) syntax: SyntaxNode,
-}
-impl Path {
-    pub fn qualifier(&self) -> Option<Path> { support::child(&self.syntax) }
-    pub fn coloncolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![::]) }
-    pub fn segment(&self) -> Option<PathSegment> { support::child(&self.syntax) }
-}
-#[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct UseTreeList {
     pub(crate) syntax: SyntaxNode,
 }
@@ -317,25 +411,6 @@ impl GenericParamList {
     pub fn r_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![>]) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
-pub struct ParamList {
-    pub(crate) syntax: SyntaxNode,
-}
-impl ParamList {
-    pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
-    pub fn self_param(&self) -> Option<SelfParam> { support::child(&self.syntax) }
-    pub fn comma_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![,]) }
-    pub fn params(&self) -> AstChildren<Param> { support::children(&self.syntax) }
-    pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
-}
-#[derive(Debug, Clone, PartialEq, Eq, Hash)]
-pub struct RetType {
-    pub(crate) syntax: SyntaxNode,
-}
-impl RetType {
-    pub fn thin_arrow_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![->]) }
-    pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
-}
-#[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct WhereClause {
     pub(crate) syntax: SyntaxNode,
 }
@@ -381,13 +456,6 @@ impl Param {
     pub fn dotdotdot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![...]) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
-pub struct TypeBoundList {
-    pub(crate) syntax: SyntaxNode,
-}
-impl TypeBoundList {
-    pub fn bounds(&self) -> AstChildren<TypeBound> { support::children(&self.syntax) }
-}
-#[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct RecordFieldList {
     pub(crate) syntax: SyntaxNode,
 }
@@ -731,7 +799,7 @@ impl MethodCallExpr {
     pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
     pub fn dot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![.]) }
     pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) }
-    pub fn type_arg_list(&self) -> Option<TypeArgList> { support::child(&self.syntax) }
+    pub fn generic_arg_list(&self) -> Option<GenericArgList> { support::child(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct ParenExpr {
@@ -866,19 +934,6 @@ impl ArgList {
     pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
-pub struct TypeArgList {
-    pub(crate) syntax: SyntaxNode,
-}
-impl TypeArgList {
-    pub fn coloncolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![::]) }
-    pub fn l_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![<]) }
-    pub fn type_args(&self) -> AstChildren<TypeArg> { support::children(&self.syntax) }
-    pub fn lifetime_args(&self) -> AstChildren<LifetimeArg> { support::children(&self.syntax) }
-    pub fn assoc_type_args(&self) -> AstChildren<AssocTypeArg> { support::children(&self.syntax) }
-    pub fn const_args(&self) -> AstChildren<ConstArg> { support::children(&self.syntax) }
-    pub fn r_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![>]) }
-}
-#[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct Condition {
     pub(crate) syntax: SyntaxNode,
 }
@@ -991,13 +1046,6 @@ impl ParenType {
     pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
-pub struct PathType {
-    pub(crate) syntax: SyntaxNode,
-}
-impl PathType {
-    pub fn path(&self) -> Option<Path> { support::child(&self.syntax) }
-}
-#[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct PointerType {
     pub(crate) syntax: SyntaxNode,
 }
@@ -1220,74 +1268,12 @@ impl MacroStmts {
     pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
-pub struct PathSegment {
-    pub(crate) syntax: SyntaxNode,
-}
-impl PathSegment {
-    pub fn coloncolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![::]) }
-    pub fn crate_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![crate]) }
-    pub fn self_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![self]) }
-    pub fn super_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![super]) }
-    pub fn l_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![<]) }
-    pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) }
-    pub fn type_arg_list(&self) -> Option<TypeArgList> { support::child(&self.syntax) }
-    pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) }
-    pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) }
-    pub fn path_type(&self) -> Option<PathType> { support::child(&self.syntax) }
-    pub fn r_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![>]) }
-}
-#[derive(Debug, Clone, PartialEq, Eq, Hash)]
-pub struct TypeArg {
-    pub(crate) syntax: SyntaxNode,
-}
-impl TypeArg {
-    pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
-}
-#[derive(Debug, Clone, PartialEq, Eq, Hash)]
-pub struct LifetimeArg {
-    pub(crate) syntax: SyntaxNode,
-}
-impl LifetimeArg {
-    pub fn lifetime_token(&self) -> Option<SyntaxToken> {
-        support::token(&self.syntax, T![lifetime])
-    }
-}
-#[derive(Debug, Clone, PartialEq, Eq, Hash)]
-pub struct AssocTypeArg {
-    pub(crate) syntax: SyntaxNode,
-}
-impl ast::TypeBoundsOwner for AssocTypeArg {}
-impl AssocTypeArg {
-    pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) }
-    pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
-    pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
-}
-#[derive(Debug, Clone, PartialEq, Eq, Hash)]
-pub struct ConstArg {
-    pub(crate) syntax: SyntaxNode,
-}
-impl ConstArg {
-    pub fn literal(&self) -> Option<Literal> { support::child(&self.syntax) }
-    pub fn block_expr(&self) -> Option<BlockExpr> { support::child(&self.syntax) }
-}
-#[derive(Debug, Clone, PartialEq, Eq, Hash)]
-pub enum Item {
-    Const(Const),
-    Enum(Enum),
-    ExternBlock(ExternBlock),
-    ExternCrate(ExternCrate),
-    Fn(Fn),
-    Impl(Impl),
-    MacroCall(MacroCall),
-    Module(Module),
-    Static(Static),
-    Struct(Struct),
-    Trait(Trait),
-    TypeAlias(TypeAlias),
-    Union(Union),
-    Use(Use),
+pub enum GenericArg {
+    TypeArg(TypeArg),
+    AssocTypeArg(AssocTypeArg),
+    LifetimeArg(LifetimeArg),
+    ConstArg(ConstArg),
 }
-impl ast::AttrsOwner for Item {}
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub enum Type {
     ArrayType(ArrayType),
@@ -1305,29 +1291,6 @@ pub enum Type {
     TupleType(TupleType),
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
-pub enum Pat {
-    OrPat(OrPat),
-    ParenPat(ParenPat),
-    RefPat(RefPat),
-    BoxPat(BoxPat),
-    BindPat(BindPat),
-    PlaceholderPat(PlaceholderPat),
-    DotDotPat(DotDotPat),
-    PathPat(PathPat),
-    RecordPat(RecordPat),
-    TupleStructPat(TupleStructPat),
-    TuplePat(TuplePat),
-    SlicePat(SlicePat),
-    RangePat(RangePat),
-    LiteralPat(LiteralPat),
-    MacroPat(MacroPat),
-}
-#[derive(Debug, Clone, PartialEq, Eq, Hash)]
-pub enum FieldList {
-    RecordFieldList(RecordFieldList),
-    TupleFieldList(TupleFieldList),
-}
-#[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub enum Expr {
     ArrayExpr(ArrayExpr),
     AwaitExpr(AwaitExpr),
@@ -1361,10 +1324,51 @@ pub enum Expr {
     WhileExpr(WhileExpr),
 }
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
-pub enum AdtDef {
+pub enum Item {
+    Const(Const),
     Enum(Enum),
-    Struct(Struct),
-    Union(Union),
+    ExternBlock(ExternBlock),
+    ExternCrate(ExternCrate),
+    Fn(Fn),
+    Impl(Impl),
+    MacroCall(MacroCall),
+    Module(Module),
+    Static(Static),
+    Struct(Struct),
+    Trait(Trait),
+    TypeAlias(TypeAlias),
+    Union(Union),
+    Use(Use),
+}
+impl ast::AttrsOwner for Item {}
+#[derive(Debug, Clone, PartialEq, Eq, Hash)]
+pub enum Pat {
+    OrPat(OrPat),
+    ParenPat(ParenPat),
+    RefPat(RefPat),
+    BoxPat(BoxPat),
+    BindPat(BindPat),
+    PlaceholderPat(PlaceholderPat),
+    DotDotPat(DotDotPat),
+    PathPat(PathPat),
+    RecordPat(RecordPat),
+    TupleStructPat(TupleStructPat),
+    TuplePat(TuplePat),
+    SlicePat(SlicePat),
+    RangePat(RangePat),
+    LiteralPat(LiteralPat),
+    MacroPat(MacroPat),
+}
+#[derive(Debug, Clone, PartialEq, Eq, Hash)]
+pub enum FieldList {
+    RecordFieldList(RecordFieldList),
+    TupleFieldList(TupleFieldList),
+}
+#[derive(Debug, Clone, PartialEq, Eq, Hash)]
+pub enum AdtDef {
+    Enum(Enum),
+    Struct(Struct),
+    Union(Union),
 }
 impl ast::AttrsOwner for AdtDef {}
 impl ast::GenericParamsOwner for AdtDef {}
@@ -1400,6 +1404,138 @@ pub enum Stmt {
     Item(Item),
     LetStmt(LetStmt),
 }
+impl AstNode for Path {
+    fn can_cast(kind: SyntaxKind) -> bool { kind == PATH }
+    fn cast(syntax: SyntaxNode) -> Option<Self> {
+        if Self::can_cast(syntax.kind()) {
+            Some(Self { syntax })
+        } else {
+            None
+        }
+    }
+    fn syntax(&self) -> &SyntaxNode { &self.syntax }
+}
+impl AstNode for PathSegment {
+    fn can_cast(kind: SyntaxKind) -> bool { kind == PATH_SEGMENT }
+    fn cast(syntax: SyntaxNode) -> Option<Self> {
+        if Self::can_cast(syntax.kind()) {
+            Some(Self { syntax })
+        } else {
+            None
+        }
+    }
+    fn syntax(&self) -> &SyntaxNode { &self.syntax }
+}
+impl AstNode for NameRef {
+    fn can_cast(kind: SyntaxKind) -> bool { kind == NAME_REF }
+    fn cast(syntax: SyntaxNode) -> Option<Self> {
+        if Self::can_cast(syntax.kind()) {
+            Some(Self { syntax })
+        } else {
+            None
+        }
+    }
+    fn syntax(&self) -> &SyntaxNode { &self.syntax }
+}
+impl AstNode for GenericArgList {
+    fn can_cast(kind: SyntaxKind) -> bool { kind == GENERIC_ARG_LIST }
+    fn cast(syntax: SyntaxNode) -> Option<Self> {
+        if Self::can_cast(syntax.kind()) {
+            Some(Self { syntax })
+        } else {
+            None
+        }
+    }
+    fn syntax(&self) -> &SyntaxNode { &self.syntax }
+}
+impl AstNode for ParamList {
+    fn can_cast(kind: SyntaxKind) -> bool { kind == PARAM_LIST }
+    fn cast(syntax: SyntaxNode) -> Option<Self> {
+        if Self::can_cast(syntax.kind()) {
+            Some(Self { syntax })
+        } else {
+            None
+        }
+    }
+    fn syntax(&self) -> &SyntaxNode { &self.syntax }
+}
+impl AstNode for RetType {
+    fn can_cast(kind: SyntaxKind) -> bool { kind == RET_TYPE }
+    fn cast(syntax: SyntaxNode) -> Option<Self> {
+        if Self::can_cast(syntax.kind()) {
+            Some(Self { syntax })
+        } else {
+            None
+        }
+    }
+    fn syntax(&self) -> &SyntaxNode { &self.syntax }
+}
+impl AstNode for PathType {
+    fn can_cast(kind: SyntaxKind) -> bool { kind == PATH_TYPE }
+    fn cast(syntax: SyntaxNode) -> Option<Self> {
+        if Self::can_cast(syntax.kind()) {
+            Some(Self { syntax })
+        } else {
+            None
+        }
+    }
+    fn syntax(&self) -> &SyntaxNode { &self.syntax }
+}
+impl AstNode for TypeArg {
+    fn can_cast(kind: SyntaxKind) -> bool { kind == TYPE_ARG }
+    fn cast(syntax: SyntaxNode) -> Option<Self> {
+        if Self::can_cast(syntax.kind()) {
+            Some(Self { syntax })
+        } else {
+            None
+        }
+    }
+    fn syntax(&self) -> &SyntaxNode { &self.syntax }
+}
+impl AstNode for AssocTypeArg {
+    fn can_cast(kind: SyntaxKind) -> bool { kind == ASSOC_TYPE_ARG }
+    fn cast(syntax: SyntaxNode) -> Option<Self> {
+        if Self::can_cast(syntax.kind()) {
+            Some(Self { syntax })
+        } else {
+            None
+        }
+    }
+    fn syntax(&self) -> &SyntaxNode { &self.syntax }
+}
+impl AstNode for LifetimeArg {
+    fn can_cast(kind: SyntaxKind) -> bool { kind == LIFETIME_ARG }
+    fn cast(syntax: SyntaxNode) -> Option<Self> {
+        if Self::can_cast(syntax.kind()) {
+            Some(Self { syntax })
+        } else {
+            None
+        }
+    }
+    fn syntax(&self) -> &SyntaxNode { &self.syntax }
+}
+impl AstNode for ConstArg {
+    fn can_cast(kind: SyntaxKind) -> bool { kind == CONST_ARG }
+    fn cast(syntax: SyntaxNode) -> Option<Self> {
+        if Self::can_cast(syntax.kind()) {
+            Some(Self { syntax })
+        } else {
+            None
+        }
+    }
+    fn syntax(&self) -> &SyntaxNode { &self.syntax }
+}
+impl AstNode for TypeBoundList {
+    fn can_cast(kind: SyntaxKind) -> bool { kind == TYPE_BOUND_LIST }
+    fn cast(syntax: SyntaxNode) -> Option<Self> {
+        if Self::can_cast(syntax.kind()) {
+            Some(Self { syntax })
+        } else {
+            None
+        }
+    }
+    fn syntax(&self) -> &SyntaxNode { &self.syntax }
+}
 impl AstNode for SourceFile {
     fn can_cast(kind: SyntaxKind) -> bool { kind == SOURCE_FILE }
     fn cast(syntax: SyntaxNode) -> Option<Self> {
@@ -1609,17 +1745,6 @@ impl AstNode for ItemList {
     }
     fn syntax(&self) -> &SyntaxNode { &self.syntax }
 }
-impl AstNode for NameRef {
-    fn can_cast(kind: SyntaxKind) -> bool { kind == NAME_REF }
-    fn cast(syntax: SyntaxNode) -> Option<Self> {
-        if Self::can_cast(syntax.kind()) {
-            Some(Self { syntax })
-        } else {
-            None
-        }
-    }
-    fn syntax(&self) -> &SyntaxNode { &self.syntax }
-}
 impl AstNode for Rename {
     fn can_cast(kind: SyntaxKind) -> bool { kind == RENAME }
     fn cast(syntax: SyntaxNode) -> Option<Self> {
@@ -1642,17 +1767,6 @@ impl AstNode for UseTree {
     }
     fn syntax(&self) -> &SyntaxNode { &self.syntax }
 }
-impl AstNode for Path {
-    fn can_cast(kind: SyntaxKind) -> bool { kind == PATH }
-    fn cast(syntax: SyntaxNode) -> Option<Self> {
-        if Self::can_cast(syntax.kind()) {
-            Some(Self { syntax })
-        } else {
-            None
-        }
-    }
-    fn syntax(&self) -> &SyntaxNode { &self.syntax }
-}
 impl AstNode for UseTreeList {
     fn can_cast(kind: SyntaxKind) -> bool { kind == USE_TREE_LIST }
     fn cast(syntax: SyntaxNode) -> Option<Self> {
@@ -1686,28 +1800,6 @@ impl AstNode for GenericParamList {
     }
     fn syntax(&self) -> &SyntaxNode { &self.syntax }
 }
-impl AstNode for ParamList {
-    fn can_cast(kind: SyntaxKind) -> bool { kind == PARAM_LIST }
-    fn cast(syntax: SyntaxNode) -> Option<Self> {
-        if Self::can_cast(syntax.kind()) {
-            Some(Self { syntax })
-        } else {
-            None
-        }
-    }
-    fn syntax(&self) -> &SyntaxNode { &self.syntax }
-}
-impl AstNode for RetType {
-    fn can_cast(kind: SyntaxKind) -> bool { kind == RET_TYPE }
-    fn cast(syntax: SyntaxNode) -> Option<Self> {
-        if Self::can_cast(syntax.kind()) {
-            Some(Self { syntax })
-        } else {
-            None
-        }
-    }
-    fn syntax(&self) -> &SyntaxNode { &self.syntax }
-}
 impl AstNode for WhereClause {
     fn can_cast(kind: SyntaxKind) -> bool { kind == WHERE_CLAUSE }
     fn cast(syntax: SyntaxNode) -> Option<Self> {
@@ -1752,17 +1844,6 @@ impl AstNode for Param {
     }
     fn syntax(&self) -> &SyntaxNode { &self.syntax }
 }
-impl AstNode for TypeBoundList {
-    fn can_cast(kind: SyntaxKind) -> bool { kind == TYPE_BOUND_LIST }
-    fn cast(syntax: SyntaxNode) -> Option<Self> {
-        if Self::can_cast(syntax.kind()) {
-            Some(Self { syntax })
-        } else {
-            None
-        }
-    }
-    fn syntax(&self) -> &SyntaxNode { &self.syntax }
-}
 impl AstNode for RecordFieldList {
     fn can_cast(kind: SyntaxKind) -> bool { kind == RECORD_FIELD_LIST }
     fn cast(syntax: SyntaxNode) -> Option<Self> {
@@ -2280,17 +2361,6 @@ impl AstNode for ArgList {
     }
     fn syntax(&self) -> &SyntaxNode { &self.syntax }
 }
-impl AstNode for TypeArgList {
-    fn can_cast(kind: SyntaxKind) -> bool { kind == TYPE_ARG_LIST }
-    fn cast(syntax: SyntaxNode) -> Option<Self> {
-        if Self::can_cast(syntax.kind()) {
-            Some(Self { syntax })
-        } else {
-            None
-        }
-    }
-    fn syntax(&self) -> &SyntaxNode { &self.syntax }
-}
 impl AstNode for Condition {
     fn can_cast(kind: SyntaxKind) -> bool { kind == CONDITION }
     fn cast(syntax: SyntaxNode) -> Option<Self> {
@@ -2423,17 +2493,6 @@ impl AstNode for ParenType {
     }
     fn syntax(&self) -> &SyntaxNode { &self.syntax }
 }
-impl AstNode for PathType {
-    fn can_cast(kind: SyntaxKind) -> bool { kind == PATH_TYPE }
-    fn cast(syntax: SyntaxNode) -> Option<Self> {
-        if Self::can_cast(syntax.kind()) {
-            Some(Self { syntax })
-        } else {
-            None
-        }
-    }
-    fn syntax(&self) -> &SyntaxNode { &self.syntax }
-}
 impl AstNode for PointerType {
     fn can_cast(kind: SyntaxKind) -> bool { kind == POINTER_TYPE }
     fn cast(syntax: SyntaxNode) -> Option<Self> {
@@ -2709,147 +2768,41 @@ impl AstNode for MacroStmts {
     }
     fn syntax(&self) -> &SyntaxNode { &self.syntax }
 }
-impl AstNode for PathSegment {
-    fn can_cast(kind: SyntaxKind) -> bool { kind == PATH_SEGMENT }
-    fn cast(syntax: SyntaxNode) -> Option<Self> {
-        if Self::can_cast(syntax.kind()) {
-            Some(Self { syntax })
-        } else {
-            None
-        }
-    }
-    fn syntax(&self) -> &SyntaxNode { &self.syntax }
-}
-impl AstNode for TypeArg {
-    fn can_cast(kind: SyntaxKind) -> bool { kind == TYPE_ARG }
-    fn cast(syntax: SyntaxNode) -> Option<Self> {
-        if Self::can_cast(syntax.kind()) {
-            Some(Self { syntax })
-        } else {
-            None
-        }
-    }
-    fn syntax(&self) -> &SyntaxNode { &self.syntax }
-}
-impl AstNode for LifetimeArg {
-    fn can_cast(kind: SyntaxKind) -> bool { kind == LIFETIME_ARG }
-    fn cast(syntax: SyntaxNode) -> Option<Self> {
-        if Self::can_cast(syntax.kind()) {
-            Some(Self { syntax })
-        } else {
-            None
-        }
-    }
-    fn syntax(&self) -> &SyntaxNode { &self.syntax }
-}
-impl AstNode for AssocTypeArg {
-    fn can_cast(kind: SyntaxKind) -> bool { kind == ASSOC_TYPE_ARG }
-    fn cast(syntax: SyntaxNode) -> Option<Self> {
-        if Self::can_cast(syntax.kind()) {
-            Some(Self { syntax })
-        } else {
-            None
-        }
-    }
-    fn syntax(&self) -> &SyntaxNode { &self.syntax }
-}
-impl AstNode for ConstArg {
-    fn can_cast(kind: SyntaxKind) -> bool { kind == CONST_ARG }
-    fn cast(syntax: SyntaxNode) -> Option<Self> {
-        if Self::can_cast(syntax.kind()) {
-            Some(Self { syntax })
-        } else {
-            None
-        }
-    }
-    fn syntax(&self) -> &SyntaxNode { &self.syntax }
-}
-impl From<Const> for Item {
-    fn from(node: Const) -> Item { Item::Const(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) }
-}
-impl From<ExternCrate> for Item {
-    fn from(node: ExternCrate) -> Item { Item::ExternCrate(node) }
-}
-impl From<Fn> for Item {
-    fn from(node: Fn) -> Item { Item::Fn(node) }
+impl From<TypeArg> for GenericArg {
+    fn from(node: TypeArg) -> GenericArg { GenericArg::TypeArg(node) }
 }
-impl From<Impl> for Item {
-    fn from(node: Impl) -> Item { Item::Impl(node) }
+impl From<AssocTypeArg> for GenericArg {
+    fn from(node: AssocTypeArg) -> GenericArg { GenericArg::AssocTypeArg(node) }
 }
-impl From<MacroCall> for Item {
-    fn from(node: MacroCall) -> Item { Item::MacroCall(node) }
+impl From<LifetimeArg> for GenericArg {
+    fn from(node: LifetimeArg) -> GenericArg { GenericArg::LifetimeArg(node) }
 }
-impl From<Module> for Item {
-    fn from(node: Module) -> Item { Item::Module(node) }
+impl From<ConstArg> for GenericArg {
+    fn from(node: ConstArg) -> GenericArg { GenericArg::ConstArg(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) }
-}
-impl From<Trait> for Item {
-    fn from(node: Trait) -> Item { Item::Trait(node) }
-}
-impl From<TypeAlias> for Item {
-    fn from(node: TypeAlias) -> Item { Item::TypeAlias(node) }
-}
-impl From<Union> for Item {
-    fn from(node: Union) -> Item { Item::Union(node) }
-}
-impl From<Use> for Item {
-    fn from(node: Use) -> Item { Item::Use(node) }
-}
-impl AstNode for Item {
+impl AstNode for GenericArg {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
-            CONST | ENUM | EXTERN_BLOCK | EXTERN_CRATE | FN | IMPL | MACRO_CALL | MODULE
-            | STATIC | STRUCT | TRAIT | TYPE_ALIAS | UNION | USE => true,
+            TYPE_ARG | ASSOC_TYPE_ARG | LIFETIME_ARG | CONST_ARG => true,
             _ => false,
         }
     }
     fn cast(syntax: SyntaxNode) -> Option<Self> {
         let res = match syntax.kind() {
-            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 => Item::Impl(Impl { syntax }),
-            MACRO_CALL => Item::MacroCall(MacroCall { syntax }),
-            MODULE => Item::Module(Module { syntax }),
-            STATIC => Item::Static(Static { syntax }),
-            STRUCT => Item::Struct(Struct { syntax }),
-            TRAIT => Item::Trait(Trait { syntax }),
-            TYPE_ALIAS => Item::TypeAlias(TypeAlias { syntax }),
-            UNION => Item::Union(Union { syntax }),
-            USE => Item::Use(Use { syntax }),
+            TYPE_ARG => GenericArg::TypeArg(TypeArg { syntax }),
+            ASSOC_TYPE_ARG => GenericArg::AssocTypeArg(AssocTypeArg { syntax }),
+            LIFETIME_ARG => GenericArg::LifetimeArg(LifetimeArg { syntax }),
+            CONST_ARG => GenericArg::ConstArg(ConstArg { syntax }),
             _ => return None,
         };
         Some(res)
     }
     fn syntax(&self) -> &SyntaxNode {
         match self {
-            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::Impl(it) => &it.syntax,
-            Item::MacroCall(it) => &it.syntax,
-            Item::Module(it) => &it.syntax,
-            Item::Static(it) => &it.syntax,
-            Item::Struct(it) => &it.syntax,
-            Item::Trait(it) => &it.syntax,
-            Item::TypeAlias(it) => &it.syntax,
-            Item::Union(it) => &it.syntax,
-            Item::Use(it) => &it.syntax,
+            GenericArg::TypeArg(it) => &it.syntax,
+            GenericArg::AssocTypeArg(it) => &it.syntax,
+            GenericArg::LifetimeArg(it) => &it.syntax,
+            GenericArg::ConstArg(it) => &it.syntax,
         }
     }
 }
@@ -2938,129 +2891,6 @@ impl AstNode for Type {
         }
     }
 }
-impl From<OrPat> for Pat {
-    fn from(node: OrPat) -> Pat { Pat::OrPat(node) }
-}
-impl From<ParenPat> for Pat {
-    fn from(node: ParenPat) -> Pat { Pat::ParenPat(node) }
-}
-impl From<RefPat> for Pat {
-    fn from(node: RefPat) -> Pat { Pat::RefPat(node) }
-}
-impl From<BoxPat> for Pat {
-    fn from(node: BoxPat) -> Pat { Pat::BoxPat(node) }
-}
-impl From<BindPat> for Pat {
-    fn from(node: BindPat) -> Pat { Pat::BindPat(node) }
-}
-impl From<PlaceholderPat> for Pat {
-    fn from(node: PlaceholderPat) -> Pat { Pat::PlaceholderPat(node) }
-}
-impl From<DotDotPat> for Pat {
-    fn from(node: DotDotPat) -> Pat { Pat::DotDotPat(node) }
-}
-impl From<PathPat> for Pat {
-    fn from(node: PathPat) -> Pat { Pat::PathPat(node) }
-}
-impl From<RecordPat> for Pat {
-    fn from(node: RecordPat) -> Pat { Pat::RecordPat(node) }
-}
-impl From<TupleStructPat> for Pat {
-    fn from(node: TupleStructPat) -> Pat { Pat::TupleStructPat(node) }
-}
-impl From<TuplePat> for Pat {
-    fn from(node: TuplePat) -> Pat { Pat::TuplePat(node) }
-}
-impl From<SlicePat> for Pat {
-    fn from(node: SlicePat) -> Pat { Pat::SlicePat(node) }
-}
-impl From<RangePat> for Pat {
-    fn from(node: RangePat) -> Pat { Pat::RangePat(node) }
-}
-impl From<LiteralPat> for Pat {
-    fn from(node: LiteralPat) -> Pat { Pat::LiteralPat(node) }
-}
-impl From<MacroPat> for Pat {
-    fn from(node: MacroPat) -> Pat { Pat::MacroPat(node) }
-}
-impl AstNode for Pat {
-    fn can_cast(kind: SyntaxKind) -> bool {
-        match kind {
-            OR_PAT | PAREN_PAT | REF_PAT | BOX_PAT | BIND_PAT | PLACEHOLDER_PAT | DOT_DOT_PAT
-            | PATH_PAT | RECORD_PAT | TUPLE_STRUCT_PAT | TUPLE_PAT | SLICE_PAT | RANGE_PAT
-            | LITERAL_PAT | MACRO_PAT => true,
-            _ => false,
-        }
-    }
-    fn cast(syntax: SyntaxNode) -> Option<Self> {
-        let res = match syntax.kind() {
-            OR_PAT => Pat::OrPat(OrPat { syntax }),
-            PAREN_PAT => Pat::ParenPat(ParenPat { syntax }),
-            REF_PAT => Pat::RefPat(RefPat { syntax }),
-            BOX_PAT => Pat::BoxPat(BoxPat { syntax }),
-            BIND_PAT => Pat::BindPat(BindPat { syntax }),
-            PLACEHOLDER_PAT => Pat::PlaceholderPat(PlaceholderPat { syntax }),
-            DOT_DOT_PAT => Pat::DotDotPat(DotDotPat { syntax }),
-            PATH_PAT => Pat::PathPat(PathPat { syntax }),
-            RECORD_PAT => Pat::RecordPat(RecordPat { syntax }),
-            TUPLE_STRUCT_PAT => Pat::TupleStructPat(TupleStructPat { syntax }),
-            TUPLE_PAT => Pat::TuplePat(TuplePat { syntax }),
-            SLICE_PAT => Pat::SlicePat(SlicePat { syntax }),
-            RANGE_PAT => Pat::RangePat(RangePat { syntax }),
-            LITERAL_PAT => Pat::LiteralPat(LiteralPat { syntax }),
-            MACRO_PAT => Pat::MacroPat(MacroPat { syntax }),
-            _ => return None,
-        };
-        Some(res)
-    }
-    fn syntax(&self) -> &SyntaxNode {
-        match self {
-            Pat::OrPat(it) => &it.syntax,
-            Pat::ParenPat(it) => &it.syntax,
-            Pat::RefPat(it) => &it.syntax,
-            Pat::BoxPat(it) => &it.syntax,
-            Pat::BindPat(it) => &it.syntax,
-            Pat::PlaceholderPat(it) => &it.syntax,
-            Pat::DotDotPat(it) => &it.syntax,
-            Pat::PathPat(it) => &it.syntax,
-            Pat::RecordPat(it) => &it.syntax,
-            Pat::TupleStructPat(it) => &it.syntax,
-            Pat::TuplePat(it) => &it.syntax,
-            Pat::SlicePat(it) => &it.syntax,
-            Pat::RangePat(it) => &it.syntax,
-            Pat::LiteralPat(it) => &it.syntax,
-            Pat::MacroPat(it) => &it.syntax,
-        }
-    }
-}
-impl From<RecordFieldList> for FieldList {
-    fn from(node: RecordFieldList) -> FieldList { FieldList::RecordFieldList(node) }
-}
-impl From<TupleFieldList> for FieldList {
-    fn from(node: TupleFieldList) -> FieldList { FieldList::TupleFieldList(node) }
-}
-impl AstNode for FieldList {
-    fn can_cast(kind: SyntaxKind) -> bool {
-        match kind {
-            RECORD_FIELD_LIST | TUPLE_FIELD_LIST => true,
-            _ => false,
-        }
-    }
-    fn cast(syntax: SyntaxNode) -> Option<Self> {
-        let res = match syntax.kind() {
-            RECORD_FIELD_LIST => FieldList::RecordFieldList(RecordFieldList { syntax }),
-            TUPLE_FIELD_LIST => FieldList::TupleFieldList(TupleFieldList { syntax }),
-            _ => return None,
-        };
-        Some(res)
-    }
-    fn syntax(&self) -> &SyntaxNode {
-        match self {
-            FieldList::RecordFieldList(it) => &it.syntax,
-            FieldList::TupleFieldList(it) => &it.syntax,
-        }
-    }
-}
 impl From<ArrayExpr> for Expr {
     fn from(node: ArrayExpr) -> Expr { Expr::ArrayExpr(node) }
 }
@@ -3145,91 +2975,303 @@ impl From<ReturnExpr> for Expr {
 impl From<TryExpr> for Expr {
     fn from(node: TryExpr) -> Expr { Expr::TryExpr(node) }
 }
-impl From<TupleExpr> for Expr {
-    fn from(node: TupleExpr) -> Expr { Expr::TupleExpr(node) }
+impl From<TupleExpr> for Expr {
+    fn from(node: TupleExpr) -> Expr { Expr::TupleExpr(node) }
+}
+impl From<WhileExpr> for Expr {
+    fn from(node: WhileExpr) -> Expr { Expr::WhileExpr(node) }
+}
+impl AstNode for Expr {
+    fn can_cast(kind: SyntaxKind) -> bool {
+        match kind {
+            ARRAY_EXPR | AWAIT_EXPR | BIN_EXPR | BLOCK_EXPR | BOX_EXPR | BREAK_EXPR | CALL_EXPR
+            | CAST_EXPR | CLOSURE_EXPR | CONTINUE_EXPR | EFFECT_EXPR | FIELD_EXPR | FOR_EXPR
+            | IF_EXPR | INDEX_EXPR | LITERAL | LOOP_EXPR | MACRO_CALL | MATCH_EXPR
+            | METHOD_CALL_EXPR | PAREN_EXPR | PATH_EXPR | PREFIX_EXPR | RANGE_EXPR
+            | RECORD_EXPR | REF_EXPR | RETURN_EXPR | TRY_EXPR | TUPLE_EXPR | WHILE_EXPR => true,
+            _ => false,
+        }
+    }
+    fn cast(syntax: SyntaxNode) -> Option<Self> {
+        let res = match syntax.kind() {
+            ARRAY_EXPR => Expr::ArrayExpr(ArrayExpr { syntax }),
+            AWAIT_EXPR => Expr::AwaitExpr(AwaitExpr { syntax }),
+            BIN_EXPR => Expr::BinExpr(BinExpr { syntax }),
+            BLOCK_EXPR => Expr::BlockExpr(BlockExpr { syntax }),
+            BOX_EXPR => Expr::BoxExpr(BoxExpr { syntax }),
+            BREAK_EXPR => Expr::BreakExpr(BreakExpr { syntax }),
+            CALL_EXPR => Expr::CallExpr(CallExpr { syntax }),
+            CAST_EXPR => Expr::CastExpr(CastExpr { syntax }),
+            CLOSURE_EXPR => Expr::ClosureExpr(ClosureExpr { syntax }),
+            CONTINUE_EXPR => Expr::ContinueExpr(ContinueExpr { syntax }),
+            EFFECT_EXPR => Expr::EffectExpr(EffectExpr { syntax }),
+            FIELD_EXPR => Expr::FieldExpr(FieldExpr { syntax }),
+            FOR_EXPR => Expr::ForExpr(ForExpr { syntax }),
+            IF_EXPR => Expr::IfExpr(IfExpr { syntax }),
+            INDEX_EXPR => Expr::IndexExpr(IndexExpr { syntax }),
+            LITERAL => Expr::Literal(Literal { syntax }),
+            LOOP_EXPR => Expr::LoopExpr(LoopExpr { syntax }),
+            MACRO_CALL => Expr::MacroCall(MacroCall { syntax }),
+            MATCH_EXPR => Expr::MatchExpr(MatchExpr { syntax }),
+            METHOD_CALL_EXPR => Expr::MethodCallExpr(MethodCallExpr { syntax }),
+            PAREN_EXPR => Expr::ParenExpr(ParenExpr { syntax }),
+            PATH_EXPR => Expr::PathExpr(PathExpr { syntax }),
+            PREFIX_EXPR => Expr::PrefixExpr(PrefixExpr { syntax }),
+            RANGE_EXPR => Expr::RangeExpr(RangeExpr { syntax }),
+            RECORD_EXPR => Expr::RecordExpr(RecordExpr { syntax }),
+            REF_EXPR => Expr::RefExpr(RefExpr { syntax }),
+            RETURN_EXPR => Expr::ReturnExpr(ReturnExpr { syntax }),
+            TRY_EXPR => Expr::TryExpr(TryExpr { syntax }),
+            TUPLE_EXPR => Expr::TupleExpr(TupleExpr { syntax }),
+            WHILE_EXPR => Expr::WhileExpr(WhileExpr { syntax }),
+            _ => return None,
+        };
+        Some(res)
+    }
+    fn syntax(&self) -> &SyntaxNode {
+        match self {
+            Expr::ArrayExpr(it) => &it.syntax,
+            Expr::AwaitExpr(it) => &it.syntax,
+            Expr::BinExpr(it) => &it.syntax,
+            Expr::BlockExpr(it) => &it.syntax,
+            Expr::BoxExpr(it) => &it.syntax,
+            Expr::BreakExpr(it) => &it.syntax,
+            Expr::CallExpr(it) => &it.syntax,
+            Expr::CastExpr(it) => &it.syntax,
+            Expr::ClosureExpr(it) => &it.syntax,
+            Expr::ContinueExpr(it) => &it.syntax,
+            Expr::EffectExpr(it) => &it.syntax,
+            Expr::FieldExpr(it) => &it.syntax,
+            Expr::ForExpr(it) => &it.syntax,
+            Expr::IfExpr(it) => &it.syntax,
+            Expr::IndexExpr(it) => &it.syntax,
+            Expr::Literal(it) => &it.syntax,
+            Expr::LoopExpr(it) => &it.syntax,
+            Expr::MacroCall(it) => &it.syntax,
+            Expr::MatchExpr(it) => &it.syntax,
+            Expr::MethodCallExpr(it) => &it.syntax,
+            Expr::ParenExpr(it) => &it.syntax,
+            Expr::PathExpr(it) => &it.syntax,
+            Expr::PrefixExpr(it) => &it.syntax,
+            Expr::RangeExpr(it) => &it.syntax,
+            Expr::RecordExpr(it) => &it.syntax,
+            Expr::RefExpr(it) => &it.syntax,
+            Expr::ReturnExpr(it) => &it.syntax,
+            Expr::TryExpr(it) => &it.syntax,
+            Expr::TupleExpr(it) => &it.syntax,
+            Expr::WhileExpr(it) => &it.syntax,
+        }
+    }
+}
+impl From<Const> for Item {
+    fn from(node: Const) -> Item { Item::Const(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) }
+}
+impl From<ExternCrate> for Item {
+    fn from(node: ExternCrate) -> Item { Item::ExternCrate(node) }
+}
+impl From<Fn> for Item {
+    fn from(node: Fn) -> Item { Item::Fn(node) }
+}
+impl From<Impl> for Item {
+    fn from(node: Impl) -> Item { Item::Impl(node) }
+}
+impl From<MacroCall> for Item {
+    fn from(node: MacroCall) -> Item { Item::MacroCall(node) }
+}
+impl From<Module> for Item {
+    fn from(node: Module) -> Item { Item::Module(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) }
+}
+impl From<Trait> for Item {
+    fn from(node: Trait) -> Item { Item::Trait(node) }
+}
+impl From<TypeAlias> for Item {
+    fn from(node: TypeAlias) -> Item { Item::TypeAlias(node) }
+}
+impl From<Union> for Item {
+    fn from(node: Union) -> Item { Item::Union(node) }
+}
+impl From<Use> for Item {
+    fn from(node: Use) -> Item { Item::Use(node) }
+}
+impl AstNode for Item {
+    fn can_cast(kind: SyntaxKind) -> bool {
+        match kind {
+            CONST | ENUM | EXTERN_BLOCK | EXTERN_CRATE | FN | IMPL | MACRO_CALL | MODULE
+            | STATIC | STRUCT | TRAIT | TYPE_ALIAS | UNION | USE => true,
+            _ => false,
+        }
+    }
+    fn cast(syntax: SyntaxNode) -> Option<Self> {
+        let res = match syntax.kind() {
+            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 => Item::Impl(Impl { syntax }),
+            MACRO_CALL => Item::MacroCall(MacroCall { syntax }),
+            MODULE => Item::Module(Module { syntax }),
+            STATIC => Item::Static(Static { syntax }),
+            STRUCT => Item::Struct(Struct { syntax }),
+            TRAIT => Item::Trait(Trait { syntax }),
+            TYPE_ALIAS => Item::TypeAlias(TypeAlias { syntax }),
+            UNION => Item::Union(Union { syntax }),
+            USE => Item::Use(Use { syntax }),
+            _ => return None,
+        };
+        Some(res)
+    }
+    fn syntax(&self) -> &SyntaxNode {
+        match self {
+            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::Impl(it) => &it.syntax,
+            Item::MacroCall(it) => &it.syntax,
+            Item::Module(it) => &it.syntax,
+            Item::Static(it) => &it.syntax,
+            Item::Struct(it) => &it.syntax,
+            Item::Trait(it) => &it.syntax,
+            Item::TypeAlias(it) => &it.syntax,
+            Item::Union(it) => &it.syntax,
+            Item::Use(it) => &it.syntax,
+        }
+    }
+}
+impl From<OrPat> for Pat {
+    fn from(node: OrPat) -> Pat { Pat::OrPat(node) }
+}
+impl From<ParenPat> for Pat {
+    fn from(node: ParenPat) -> Pat { Pat::ParenPat(node) }
+}
+impl From<RefPat> for Pat {
+    fn from(node: RefPat) -> Pat { Pat::RefPat(node) }
+}
+impl From<BoxPat> for Pat {
+    fn from(node: BoxPat) -> Pat { Pat::BoxPat(node) }
+}
+impl From<BindPat> for Pat {
+    fn from(node: BindPat) -> Pat { Pat::BindPat(node) }
+}
+impl From<PlaceholderPat> for Pat {
+    fn from(node: PlaceholderPat) -> Pat { Pat::PlaceholderPat(node) }
+}
+impl From<DotDotPat> for Pat {
+    fn from(node: DotDotPat) -> Pat { Pat::DotDotPat(node) }
+}
+impl From<PathPat> for Pat {
+    fn from(node: PathPat) -> Pat { Pat::PathPat(node) }
+}
+impl From<RecordPat> for Pat {
+    fn from(node: RecordPat) -> Pat { Pat::RecordPat(node) }
+}
+impl From<TupleStructPat> for Pat {
+    fn from(node: TupleStructPat) -> Pat { Pat::TupleStructPat(node) }
+}
+impl From<TuplePat> for Pat {
+    fn from(node: TuplePat) -> Pat { Pat::TuplePat(node) }
+}
+impl From<SlicePat> for Pat {
+    fn from(node: SlicePat) -> Pat { Pat::SlicePat(node) }
+}
+impl From<RangePat> for Pat {
+    fn from(node: RangePat) -> Pat { Pat::RangePat(node) }
+}
+impl From<LiteralPat> for Pat {
+    fn from(node: LiteralPat) -> Pat { Pat::LiteralPat(node) }
+}
+impl From<MacroPat> for Pat {
+    fn from(node: MacroPat) -> Pat { Pat::MacroPat(node) }
+}
+impl AstNode for Pat {
+    fn can_cast(kind: SyntaxKind) -> bool {
+        match kind {
+            OR_PAT | PAREN_PAT | REF_PAT | BOX_PAT | BIND_PAT | PLACEHOLDER_PAT | DOT_DOT_PAT
+            | PATH_PAT | RECORD_PAT | TUPLE_STRUCT_PAT | TUPLE_PAT | SLICE_PAT | RANGE_PAT
+            | LITERAL_PAT | MACRO_PAT => true,
+            _ => false,
+        }
+    }
+    fn cast(syntax: SyntaxNode) -> Option<Self> {
+        let res = match syntax.kind() {
+            OR_PAT => Pat::OrPat(OrPat { syntax }),
+            PAREN_PAT => Pat::ParenPat(ParenPat { syntax }),
+            REF_PAT => Pat::RefPat(RefPat { syntax }),
+            BOX_PAT => Pat::BoxPat(BoxPat { syntax }),
+            BIND_PAT => Pat::BindPat(BindPat { syntax }),
+            PLACEHOLDER_PAT => Pat::PlaceholderPat(PlaceholderPat { syntax }),
+            DOT_DOT_PAT => Pat::DotDotPat(DotDotPat { syntax }),
+            PATH_PAT => Pat::PathPat(PathPat { syntax }),
+            RECORD_PAT => Pat::RecordPat(RecordPat { syntax }),
+            TUPLE_STRUCT_PAT => Pat::TupleStructPat(TupleStructPat { syntax }),
+            TUPLE_PAT => Pat::TuplePat(TuplePat { syntax }),
+            SLICE_PAT => Pat::SlicePat(SlicePat { syntax }),
+            RANGE_PAT => Pat::RangePat(RangePat { syntax }),
+            LITERAL_PAT => Pat::LiteralPat(LiteralPat { syntax }),
+            MACRO_PAT => Pat::MacroPat(MacroPat { syntax }),
+            _ => return None,
+        };
+        Some(res)
+    }
+    fn syntax(&self) -> &SyntaxNode {
+        match self {
+            Pat::OrPat(it) => &it.syntax,
+            Pat::ParenPat(it) => &it.syntax,
+            Pat::RefPat(it) => &it.syntax,
+            Pat::BoxPat(it) => &it.syntax,
+            Pat::BindPat(it) => &it.syntax,
+            Pat::PlaceholderPat(it) => &it.syntax,
+            Pat::DotDotPat(it) => &it.syntax,
+            Pat::PathPat(it) => &it.syntax,
+            Pat::RecordPat(it) => &it.syntax,
+            Pat::TupleStructPat(it) => &it.syntax,
+            Pat::TuplePat(it) => &it.syntax,
+            Pat::SlicePat(it) => &it.syntax,
+            Pat::RangePat(it) => &it.syntax,
+            Pat::LiteralPat(it) => &it.syntax,
+            Pat::MacroPat(it) => &it.syntax,
+        }
+    }
+}
+impl From<RecordFieldList> for FieldList {
+    fn from(node: RecordFieldList) -> FieldList { FieldList::RecordFieldList(node) }
 }
-impl From<WhileExpr> for Expr {
-    fn from(node: WhileExpr) -> Expr { Expr::WhileExpr(node) }
+impl From<TupleFieldList> for FieldList {
+    fn from(node: TupleFieldList) -> FieldList { FieldList::TupleFieldList(node) }
 }
-impl AstNode for Expr {
+impl AstNode for FieldList {
     fn can_cast(kind: SyntaxKind) -> bool {
         match kind {
-            ARRAY_EXPR | AWAIT_EXPR | BIN_EXPR | BLOCK_EXPR | BOX_EXPR | BREAK_EXPR | CALL_EXPR
-            | CAST_EXPR | CLOSURE_EXPR | CONTINUE_EXPR | EFFECT_EXPR | FIELD_EXPR | FOR_EXPR
-            | IF_EXPR | INDEX_EXPR | LITERAL | LOOP_EXPR | MACRO_CALL | MATCH_EXPR
-            | METHOD_CALL_EXPR | PAREN_EXPR | PATH_EXPR | PREFIX_EXPR | RANGE_EXPR
-            | RECORD_EXPR | REF_EXPR | RETURN_EXPR | TRY_EXPR | TUPLE_EXPR | WHILE_EXPR => true,
+            RECORD_FIELD_LIST | TUPLE_FIELD_LIST => true,
             _ => false,
         }
     }
     fn cast(syntax: SyntaxNode) -> Option<Self> {
         let res = match syntax.kind() {
-            ARRAY_EXPR => Expr::ArrayExpr(ArrayExpr { syntax }),
-            AWAIT_EXPR => Expr::AwaitExpr(AwaitExpr { syntax }),
-            BIN_EXPR => Expr::BinExpr(BinExpr { syntax }),
-            BLOCK_EXPR => Expr::BlockExpr(BlockExpr { syntax }),
-            BOX_EXPR => Expr::BoxExpr(BoxExpr { syntax }),
-            BREAK_EXPR => Expr::BreakExpr(BreakExpr { syntax }),
-            CALL_EXPR => Expr::CallExpr(CallExpr { syntax }),
-            CAST_EXPR => Expr::CastExpr(CastExpr { syntax }),
-            CLOSURE_EXPR => Expr::ClosureExpr(ClosureExpr { syntax }),
-            CONTINUE_EXPR => Expr::ContinueExpr(ContinueExpr { syntax }),
-            EFFECT_EXPR => Expr::EffectExpr(EffectExpr { syntax }),
-            FIELD_EXPR => Expr::FieldExpr(FieldExpr { syntax }),
-            FOR_EXPR => Expr::ForExpr(ForExpr { syntax }),
-            IF_EXPR => Expr::IfExpr(IfExpr { syntax }),
-            INDEX_EXPR => Expr::IndexExpr(IndexExpr { syntax }),
-            LITERAL => Expr::Literal(Literal { syntax }),
-            LOOP_EXPR => Expr::LoopExpr(LoopExpr { syntax }),
-            MACRO_CALL => Expr::MacroCall(MacroCall { syntax }),
-            MATCH_EXPR => Expr::MatchExpr(MatchExpr { syntax }),
-            METHOD_CALL_EXPR => Expr::MethodCallExpr(MethodCallExpr { syntax }),
-            PAREN_EXPR => Expr::ParenExpr(ParenExpr { syntax }),
-            PATH_EXPR => Expr::PathExpr(PathExpr { syntax }),
-            PREFIX_EXPR => Expr::PrefixExpr(PrefixExpr { syntax }),
-            RANGE_EXPR => Expr::RangeExpr(RangeExpr { syntax }),
-            RECORD_EXPR => Expr::RecordExpr(RecordExpr { syntax }),
-            REF_EXPR => Expr::RefExpr(RefExpr { syntax }),
-            RETURN_EXPR => Expr::ReturnExpr(ReturnExpr { syntax }),
-            TRY_EXPR => Expr::TryExpr(TryExpr { syntax }),
-            TUPLE_EXPR => Expr::TupleExpr(TupleExpr { syntax }),
-            WHILE_EXPR => Expr::WhileExpr(WhileExpr { syntax }),
+            RECORD_FIELD_LIST => FieldList::RecordFieldList(RecordFieldList { syntax }),
+            TUPLE_FIELD_LIST => FieldList::TupleFieldList(TupleFieldList { syntax }),
             _ => return None,
         };
         Some(res)
     }
     fn syntax(&self) -> &SyntaxNode {
         match self {
-            Expr::ArrayExpr(it) => &it.syntax,
-            Expr::AwaitExpr(it) => &it.syntax,
-            Expr::BinExpr(it) => &it.syntax,
-            Expr::BlockExpr(it) => &it.syntax,
-            Expr::BoxExpr(it) => &it.syntax,
-            Expr::BreakExpr(it) => &it.syntax,
-            Expr::CallExpr(it) => &it.syntax,
-            Expr::CastExpr(it) => &it.syntax,
-            Expr::ClosureExpr(it) => &it.syntax,
-            Expr::ContinueExpr(it) => &it.syntax,
-            Expr::EffectExpr(it) => &it.syntax,
-            Expr::FieldExpr(it) => &it.syntax,
-            Expr::ForExpr(it) => &it.syntax,
-            Expr::IfExpr(it) => &it.syntax,
-            Expr::IndexExpr(it) => &it.syntax,
-            Expr::Literal(it) => &it.syntax,
-            Expr::LoopExpr(it) => &it.syntax,
-            Expr::MacroCall(it) => &it.syntax,
-            Expr::MatchExpr(it) => &it.syntax,
-            Expr::MethodCallExpr(it) => &it.syntax,
-            Expr::ParenExpr(it) => &it.syntax,
-            Expr::PathExpr(it) => &it.syntax,
-            Expr::PrefixExpr(it) => &it.syntax,
-            Expr::RangeExpr(it) => &it.syntax,
-            Expr::RecordExpr(it) => &it.syntax,
-            Expr::RefExpr(it) => &it.syntax,
-            Expr::ReturnExpr(it) => &it.syntax,
-            Expr::TryExpr(it) => &it.syntax,
-            Expr::TupleExpr(it) => &it.syntax,
-            Expr::WhileExpr(it) => &it.syntax,
+            FieldList::RecordFieldList(it) => &it.syntax,
+            FieldList::TupleFieldList(it) => &it.syntax,
         }
     }
 }
@@ -3379,7 +3421,7 @@ impl From<Item> for Stmt {
 impl From<LetStmt> for Stmt {
     fn from(node: LetStmt) -> Stmt { Stmt::LetStmt(node) }
 }
-impl std::fmt::Display for Item {
+impl std::fmt::Display for GenericArg {
     fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         std::fmt::Display::fmt(self.syntax(), f)
     }
@@ -3389,17 +3431,22 @@ impl std::fmt::Display for Type {
         std::fmt::Display::fmt(self.syntax(), f)
     }
 }
-impl std::fmt::Display for Pat {
+impl std::fmt::Display for Expr {
     fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         std::fmt::Display::fmt(self.syntax(), f)
     }
 }
-impl std::fmt::Display for FieldList {
+impl std::fmt::Display for Item {
     fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         std::fmt::Display::fmt(self.syntax(), f)
     }
 }
-impl std::fmt::Display for Expr {
+impl std::fmt::Display for Pat {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
+impl std::fmt::Display for FieldList {
     fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         std::fmt::Display::fmt(self.syntax(), f)
     }
@@ -3429,6 +3476,66 @@ impl std::fmt::Display for Stmt {
         std::fmt::Display::fmt(self.syntax(), f)
     }
 }
+impl std::fmt::Display for Path {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
+impl std::fmt::Display for PathSegment {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
+impl std::fmt::Display for NameRef {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
+impl std::fmt::Display for GenericArgList {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
+impl std::fmt::Display for ParamList {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
+impl std::fmt::Display for RetType {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
+impl std::fmt::Display for PathType {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
+impl std::fmt::Display for TypeArg {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
+impl std::fmt::Display for AssocTypeArg {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
+impl std::fmt::Display for LifetimeArg {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
+impl std::fmt::Display for ConstArg {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
+impl std::fmt::Display for TypeBoundList {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        std::fmt::Display::fmt(self.syntax(), f)
+    }
+}
 impl std::fmt::Display for SourceFile {
     fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         std::fmt::Display::fmt(self.syntax(), f)
@@ -3524,11 +3631,6 @@ impl std::fmt::Display for ItemList {
         std::fmt::Display::fmt(self.syntax(), f)
     }
 }
-impl std::fmt::Display for NameRef {
-    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
-        std::fmt::Display::fmt(self.syntax(), f)
-    }
-}
 impl std::fmt::Display for Rename {
     fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         std::fmt::Display::fmt(self.syntax(), f)
@@ -3539,11 +3641,6 @@ impl std::fmt::Display for UseTree {
         std::fmt::Display::fmt(self.syntax(), f)
     }
 }
-impl std::fmt::Display for Path {
-    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
-        std::fmt::Display::fmt(self.syntax(), f)
-    }
-}
 impl std::fmt::Display for UseTreeList {
     fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         std::fmt::Display::fmt(self.syntax(), f)
@@ -3559,16 +3656,6 @@ impl std::fmt::Display for GenericParamList {
         std::fmt::Display::fmt(self.syntax(), f)
     }
 }
-impl std::fmt::Display for ParamList {
-    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
-        std::fmt::Display::fmt(self.syntax(), f)
-    }
-}
-impl std::fmt::Display for RetType {
-    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
-        std::fmt::Display::fmt(self.syntax(), f)
-    }
-}
 impl std::fmt::Display for WhereClause {
     fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         std::fmt::Display::fmt(self.syntax(), f)
@@ -3589,11 +3676,6 @@ impl std::fmt::Display for Param {
         std::fmt::Display::fmt(self.syntax(), f)
     }
 }
-impl std::fmt::Display for TypeBoundList {
-    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
-        std::fmt::Display::fmt(self.syntax(), f)
-    }
-}
 impl std::fmt::Display for RecordFieldList {
     fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         std::fmt::Display::fmt(self.syntax(), f)
@@ -3829,11 +3911,6 @@ impl std::fmt::Display for ArgList {
         std::fmt::Display::fmt(self.syntax(), f)
     }
 }
-impl std::fmt::Display for TypeArgList {
-    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
-        std::fmt::Display::fmt(self.syntax(), f)
-    }
-}
 impl std::fmt::Display for Condition {
     fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         std::fmt::Display::fmt(self.syntax(), f)
@@ -3894,11 +3971,6 @@ impl std::fmt::Display for ParenType {
         std::fmt::Display::fmt(self.syntax(), f)
     }
 }
-impl std::fmt::Display for PathType {
-    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
-        std::fmt::Display::fmt(self.syntax(), f)
-    }
-}
 impl std::fmt::Display for PointerType {
     fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         std::fmt::Display::fmt(self.syntax(), f)
@@ -4024,28 +4096,3 @@ impl std::fmt::Display for MacroStmts {
         std::fmt::Display::fmt(self.syntax(), f)
     }
 }
-impl std::fmt::Display for PathSegment {
-    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
-        std::fmt::Display::fmt(self.syntax(), f)
-    }
-}
-impl std::fmt::Display for TypeArg {
-    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
-        std::fmt::Display::fmt(self.syntax(), f)
-    }
-}
-impl std::fmt::Display for LifetimeArg {
-    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
-        std::fmt::Display::fmt(self.syntax(), f)
-    }
-}
-impl std::fmt::Display for AssocTypeArg {
-    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
-        std::fmt::Display::fmt(self.syntax(), f)
-    }
-}
-impl std::fmt::Display for ConstArg {
-    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
-        std::fmt::Display::fmt(self.syntax(), f)
-    }
-}
diff --git a/xtask/src/ast_src.rs b/xtask/src/ast_src.rs
index 427406249c..762d9265e9 100644
--- a/xtask/src/ast_src.rs
+++ b/xtask/src/ast_src.rs
@@ -208,7 +208,7 @@ pub(crate) const KINDS_SRC: KindsSrc = KindsSrc {
         "LIFETIME_PARAM",
         "TYPE_PARAM",
         "CONST_PARAM",
-        "TYPE_ARG_LIST",
+        "GENERIC_ARG_LIST",
         "LIFETIME_ARG",
         "TYPE_ARG",
         "ASSOC_TYPE_ARG",
diff --git a/xtask/src/codegen/rust.ungram b/xtask/src/codegen/rust.ungram
index bc1dd67611..1d8bed0b4b 100644
--- a/xtask/src/codegen/rust.ungram
+++ b/xtask/src/codegen/rust.ungram
@@ -1,3 +1,34 @@
+Path =
+  (qualifier:Path '::')? segment:PathSegment
+
+PathSegment =
+  'crate' | 'self' | 'super'
+| '::' NameRef
+| NameRef GenericArgList?
+| NameRef ParamList RetType?
+| '<' PathType ('as' PathType)? '>'
+
+GenericArgList =
+  '::'? '<' (GenericArg (',' GenericArg)* ','?)? '>'
+
+GenericArg =
+  TypeArg
+| AssocTypeArg
+| LifetimeArg
+| ConstArg
+
+TypeArg =
+  Type
+
+AssocTypeArg =
+  NameRef (':' TypeBoundList | '=' Type)
+
+LifetimeArg =
+  'lifetime'
+
+ConstArg =
+  Expr
+
 SourceFile =
   'shebang'?
   Attr*
@@ -318,7 +349,7 @@ ArgList =
   '(' args:(Expr (',' Expr)* ','?)? ')'
 
 MethodCallExpr =
-  Attr* Expr '.' NameRef TypeArgList? ArgList
+  Attr* Expr '.' NameRef GenericArgList? ArgList
 
 FieldExpr =
   Attr* Expr '.' NameRef
@@ -521,33 +552,6 @@ MacroStmts =
   statements:Stmt*
   Expr?
 
-Path =
-  (qualifier:Path '::')? segment:PathSegment
-
-PathSegment =
-  '::' | 'crate' | 'self' | 'super'
-| '<' NameRef TypeArgList ParamList RetType PathType '>'
-
-TypeArgList =
-  '::'? '<'
-    TypeArg*
-    LifetimeArg*
-    AssocTypeArg*
-    ConstArg*
-  '>'
-
-TypeArg =
-  Type
-
-AssocTypeArg =
-  NameRef (':' TypeBoundList | '=' Type)
-
-LifetimeArg =
-  'lifetime'
-
-ConstArg =
-  Literal | BlockExpr BlockExpr
-
 Pat =
   OrPat
 | ParenPat


Test patch:
diff --git a/crates/ra_syntax/test_data/parser/err/0012_broken_lambda.rast b/crates/ra_syntax/test_data/parser/err/0012_broken_lambda.rast
index 0afa24b775..307d9b31b9 100644
--- a/crates/ra_syntax/test_data/parser/err/0012_broken_lambda.rast
+++ b/crates/ra_syntax/test_data/parser/err/0012_broken_lambda.rast
@@ -25,7 +25,7 @@ SOURCE_FILE@0..389
           PATH_SEGMENT@29..37
             NAME_REF@29..33
               IDENT@29..33 "Sink"
-            TYPE_ARG_LIST@33..37
+            GENERIC_ARG_LIST@33..37
               L_ANGLE@33..34
               LIFETIME_ARG@34..36
                 LIFETIME@34..36 "'a"
@@ -79,7 +79,7 @@ SOURCE_FILE@0..389
             PATH_SEGMENT@82..92
               NAME_REF@82..85
                 IDENT@82..85 "Vec"
-              TYPE_ARG_LIST@85..92
+              GENERIC_ARG_LIST@85..92
                 L_ANGLE@85..86
                 TYPE_ARG@86..91
                   PATH_TYPE@86..91
diff --git a/crates/ra_syntax/test_data/parser/err/0013_invalid_type.rast b/crates/ra_syntax/test_data/parser/err/0013_invalid_type.rast
index 3eef848fc8..f48ab6e712 100644
--- a/crates/ra_syntax/test_data/parser/err/0013_invalid_type.rast
+++ b/crates/ra_syntax/test_data/parser/err/0013_invalid_type.rast
@@ -16,7 +16,7 @@ SOURCE_FILE@0..86
             PATH_SEGMENT@22..68
               NAME_REF@22..29
                 IDENT@22..29 "RefCell"
-              TYPE_ARG_LIST@29..68
+              GENERIC_ARG_LIST@29..68
                 L_ANGLE@29..30 "<"
                 TYPE_ARG@30..68
                   PATH_TYPE@30..68
@@ -24,7 +24,7 @@ SOURCE_FILE@0..86
                       PATH_SEGMENT@30..68
                         NAME_REF@30..37
                           IDENT@30..37 "HashMap"
-                        TYPE_ARG_LIST@37..68
+                        GENERIC_ARG_LIST@37..68
                           L_ANGLE@37..38 "<"
                           WHITESPACE@38..47 "\n        "
                           TYPE_ARG@47..53
@@ -41,7 +41,7 @@ SOURCE_FILE@0..86
                                 PATH_SEGMENT@63..68
                                   NAME_REF@63..66
                                     IDENT@63..66 "Box"
-                                  TYPE_ARG_LIST@66..68
+                                  GENERIC_ARG_LIST@66..68
                                     L_ANGLE@66..67 "<"
                                     TYPE_ARG@67..68
                                       ERROR@67..68
diff --git a/crates/ra_syntax/test_data/parser/err/0024_many_type_parens.rast b/crates/ra_syntax/test_data/parser/err/0024_many_type_parens.rast
index 4c2d1ad686..1cb1e97574 100644
--- a/crates/ra_syntax/test_data/parser/err/0024_many_type_parens.rast
+++ b/crates/ra_syntax/test_data/parser/err/0024_many_type_parens.rast
@@ -50,7 +50,7 @@ SOURCE_FILE@0..240
                   PATH_SEGMENT@37..46
                     NAME_REF@37..42
                       IDENT@37..42 "Trait"
-                    TYPE_ARG_LIST@42..46
+                    GENERIC_ARG_LIST@42..46
                       L_ANGLE@42..43 "<"
                       LIFETIME_ARG@43..45
                         LIFETIME@43..45 "\'a"
@@ -92,7 +92,7 @@ SOURCE_FILE@0..240
                   PATH_SEGMENT@78..88
                     NAME_REF@78..81
                       IDENT@78..81 "Box"
-                    TYPE_ARG_LIST@81..88
+                    GENERIC_ARG_LIST@81..88
                       L_ANGLE@81..82 "<"
                       TYPE_ARG@82..88
                         PAREN_TYPE@82..88
@@ -133,7 +133,7 @@ SOURCE_FILE@0..240
                     PATH_SEGMENT@111..120
                       NAME_REF@111..116
                         IDENT@111..116 "Trait"
-                      TYPE_ARG_LIST@116..120
+                      GENERIC_ARG_LIST@116..120
                         L_ANGLE@116..117 "<"
                         LIFETIME_ARG@117..119
                           LIFETIME@117..119 "\'a"
@@ -156,7 +156,7 @@ SOURCE_FILE@0..240
             PATH_SEGMENT@135..141
               NAME_REF@135..138
                 IDENT@135..138 "Box"
-              TYPE_ARG_LIST@138..141
+              GENERIC_ARG_LIST@138..141
                 L_ANGLE@138..139 "<"
                 TYPE_ARG@139..141
                   PAREN_TYPE@139..141
@@ -235,7 +235,7 @@ SOURCE_FILE@0..240
                   PATH_SEGMENT@192..215
                     NAME_REF@192..195
                       IDENT@192..195 "Box"
-                    TYPE_ARG_LIST@195..215
+                    GENERIC_ARG_LIST@195..215
                       L_ANGLE@195..196 "<"
                       TYPE_ARG@196..215
                         PAREN_TYPE@196..215
@@ -253,7 +253,7 @@ SOURCE_FILE@0..240
                                 PATH_SEGMENT@205..214
                                   NAME_REF@205..210
                                     IDENT@205..210 "Trait"
-                                  TYPE_ARG_LIST@210..214
+                                  GENERIC_ARG_LIST@210..214
                                     L_ANGLE@210..211 "<"
                                     LIFETIME_ARG@211..213
                                       LIFETIME@211..213 "\'a"
diff --git a/crates/ra_syntax/test_data/parser/err/0026_imp_recovery.rast b/crates/ra_syntax/test_data/parser/err/0026_imp_recovery.rast
index 7e4b11c272..1b08c834eb 100644
--- a/crates/ra_syntax/test_data/parser/err/0026_imp_recovery.rast
+++ b/crates/ra_syntax/test_data/parser/err/0026_imp_recovery.rast
@@ -31,7 +31,7 @@ SOURCE_FILE@0..38
         PATH_SEGMENT@23..34
           NAME_REF@23..31
             IDENT@23..31 "OnceCell"
-          TYPE_ARG_LIST@31..34
+          GENERIC_ARG_LIST@31..34
             L_ANGLE@31..32 "<"
             TYPE_ARG@32..33
               PATH_TYPE@32..33
diff --git a/crates/ra_syntax/test_data/parser/err/0039_lambda_recovery.rast b/crates/ra_syntax/test_data/parser/err/0039_lambda_recovery.rast
index 0678d42781..7a5e115bc4 100644
--- a/crates/ra_syntax/test_data/parser/err/0039_lambda_recovery.rast
+++ b/crates/ra_syntax/test_data/parser/err/0039_lambda_recovery.rast
@@ -62,7 +62,7 @@ SOURCE_FILE@0..83
           DOT@66..67 "."
           NAME_REF@67..70
             IDENT@67..70 "max"
-          TYPE_ARG_LIST@70..77
+          GENERIC_ARG_LIST@70..77
             COLON2@70..72 "::"
             L_ANGLE@72..73 "<"
             TYPE_ARG@73..76
diff --git a/crates/ra_syntax/test_data/parser/fragments/type/ok/0000_result.rast b/crates/ra_syntax/test_data/parser/fragments/type/ok/0000_result.rast
index 8831cfa6c8..38c15b5815 100644
--- a/crates/ra_syntax/test_data/parser/fragments/type/ok/0000_result.rast
+++ b/crates/ra_syntax/test_data/parser/fragments/type/ok/0000_result.rast
@@ -3,7 +3,7 @@ PATH_TYPE@0..16
     PATH_SEGMENT@0..16
       NAME_REF@0..6
         IDENT@0..6 "Result"
-      TYPE_ARG_LIST@6..16
+      GENERIC_ARG_LIST@6..16
         L_ANGLE@6..7 "<"
         TYPE_ARG@7..10
           PATH_TYPE@7..10
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0004_value_parameters_no_patterns.rast b/crates/ra_syntax/test_data/parser/inline/ok/0004_value_parameters_no_patterns.rast
index ace8ad050a..44d92aedbc 100644
--- a/crates/ra_syntax/test_data/parser/inline/ok/0004_value_parameters_no_patterns.rast
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0004_value_parameters_no_patterns.rast
@@ -12,7 +12,7 @@ SOURCE_FILE@0..39
         PATH_SEGMENT@9..37
           NAME_REF@9..12
             IDENT@9..12 "Box"
-          TYPE_ARG_LIST@12..37
+          GENERIC_ARG_LIST@12..37
             L_ANGLE@12..13 "<"
             TYPE_ARG@13..36
               PATH_TYPE@13..36
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0018_arb_self_types.rast b/crates/ra_syntax/test_data/parser/inline/ok/0018_arb_self_types.rast
index 20b2b6c193..1b31aa95a2 100644
--- a/crates/ra_syntax/test_data/parser/inline/ok/0018_arb_self_types.rast
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0018_arb_self_types.rast
@@ -53,7 +53,7 @@ SOURCE_FILE@0..69
                 PATH_SEGMENT@53..62
                   NAME_REF@53..56
                     IDENT@53..56 "Box"
-                  TYPE_ARG_LIST@56..62
+                  GENERIC_ARG_LIST@56..62
                     L_ANGLE@56..57 "<"
                     TYPE_ARG@57..61
                       PATH_TYPE@57..61
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0028_impl_trait_type.rast b/crates/ra_syntax/test_data/parser/inline/ok/0028_impl_trait_type.rast
index f45f3cab89..32b2959bdf 100644
--- a/crates/ra_syntax/test_data/parser/inline/ok/0028_impl_trait_type.rast
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0028_impl_trait_type.rast
@@ -17,7 +17,7 @@ SOURCE_FILE@0..43
               PATH_SEGMENT@14..36
                 NAME_REF@14..22
                   IDENT@14..22 "Iterator"
-                TYPE_ARG_LIST@22..36
+                GENERIC_ARG_LIST@22..36
                   L_ANGLE@22..23 "<"
                   ASSOC_TYPE_ARG@23..35
                     NAME_REF@23..27
@@ -28,7 +28,7 @@ SOURCE_FILE@0..43
                         PATH_SEGMENT@28..35
                           NAME_REF@28..31
                             IDENT@28..31 "Foo"
-                          TYPE_ARG_LIST@31..35
+                          GENERIC_ARG_LIST@31..35
                             L_ANGLE@31..32 "<"
                             LIFETIME_ARG@32..34
                               LIFETIME@32..34 "\'a"
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0039_type_arg.rast b/crates/ra_syntax/test_data/parser/inline/ok/0039_type_arg.rast
index 2185d3c915..69e98b9d6c 100644
--- a/crates/ra_syntax/test_data/parser/inline/ok/0039_type_arg.rast
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0039_type_arg.rast
@@ -12,7 +12,7 @@ SOURCE_FILE@0..46
         PATH_SEGMENT@9..44
           NAME_REF@9..10
             IDENT@9..10 "B"
-          TYPE_ARG_LIST@10..44
+          GENERIC_ARG_LIST@10..44
             L_ANGLE@10..11 "<"
             LIFETIME_ARG@11..18
               LIFETIME@11..18 "\'static"
@@ -27,7 +27,8 @@ SOURCE_FILE@0..46
             COMMA@23..24 ","
             WHITESPACE@24..25 " "
             CONST_ARG@25..26
-              INT_NUMBER@25..26 "1"
+              LITERAL@25..26
+                INT_NUMBER@25..26 "1"
             COMMA@26..27 ","
             WHITESPACE@27..28 " "
             CONST_ARG@28..33
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0045_param_list_opt_patterns.rast b/crates/ra_syntax/test_data/parser/inline/ok/0045_param_list_opt_patterns.rast
index d4235a8b1c..c100d1c713 100644
--- a/crates/ra_syntax/test_data/parser/inline/ok/0045_param_list_opt_patterns.rast
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0045_param_list_opt_patterns.rast
@@ -30,7 +30,7 @@ SOURCE_FILE@0..35
                             PATH_SEGMENT@21..28
                               NAME_REF@21..24
                                 IDENT@21..24 "Foo"
-                              TYPE_ARG_LIST@24..28
+                              GENERIC_ARG_LIST@24..28
                                 L_ANGLE@24..25 "<"
                                 LIFETIME_ARG@25..27
                                   LIFETIME@25..27 "\'a"
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0048_path_type_with_bounds.rast b/crates/ra_syntax/test_data/parser/inline/ok/0048_path_type_with_bounds.rast
index 37757ccd45..4d8404e7c0 100644
--- a/crates/ra_syntax/test_data/parser/inline/ok/0048_path_type_with_bounds.rast
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0048_path_type_with_bounds.rast
@@ -16,7 +16,7 @@ SOURCE_FILE@0..58
           PATH_SEGMENT@12..23
             NAME_REF@12..15
               IDENT@12..15 "Box"
-            TYPE_ARG_LIST@15..23
+            GENERIC_ARG_LIST@15..23
               L_ANGLE@15..16 "<"
               TYPE_ARG@16..22
                 DYN_TRAIT_TYPE@16..22
@@ -55,7 +55,7 @@ SOURCE_FILE@0..58
           PATH_SEGMENT@39..54
             NAME_REF@39..42
               IDENT@39..42 "Box"
-            TYPE_ARG_LIST@42..54
+            GENERIC_ARG_LIST@42..54
               L_ANGLE@42..43 "<"
               TYPE_ARG@43..53
                 DYN_TRAIT_TYPE@43..53
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0053_path_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0053_path_expr.rast
index 2bfb524530..de2016f188 100644
--- a/crates/ra_syntax/test_data/parser/inline/ok/0053_path_expr.rast
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0053_path_expr.rast
@@ -60,7 +60,7 @@ SOURCE_FILE@0..91
               COLON2@56..58 "::"
               NAME_REF@58..59
                 IDENT@58..59 "a"
-              TYPE_ARG_LIST@59..64
+              GENERIC_ARG_LIST@59..64
                 COLON2@59..61 "::"
                 L_ANGLE@61..62 "<"
                 TYPE_ARG@62..63
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0065_dyn_trait_type.rast b/crates/ra_syntax/test_data/parser/inline/ok/0065_dyn_trait_type.rast
index 629fea99d4..3a7fcfe248 100644
--- a/crates/ra_syntax/test_data/parser/inline/ok/0065_dyn_trait_type.rast
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0065_dyn_trait_type.rast
@@ -17,7 +17,7 @@ SOURCE_FILE@0..42
               PATH_SEGMENT@13..35
                 NAME_REF@13..21
                   IDENT@13..21 "Iterator"
-                TYPE_ARG_LIST@21..35
+                GENERIC_ARG_LIST@21..35
                   L_ANGLE@21..22 "<"
                   ASSOC_TYPE_ARG@22..34
                     NAME_REF@22..26
@@ -28,7 +28,7 @@ SOURCE_FILE@0..42
                         PATH_SEGMENT@27..34
                           NAME_REF@27..30
                             IDENT@27..30 "Foo"
-                          TYPE_ARG_LIST@30..34
+                          GENERIC_ARG_LIST@30..34
                             L_ANGLE@30..31 "<"
                             LIFETIME_ARG@31..33
                               LIFETIME@31..33 "\'a"
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0081_for_type.rast b/crates/ra_syntax/test_data/parser/inline/ok/0081_for_type.rast
index e7629ac031..5f48075221 100644
--- a/crates/ra_syntax/test_data/parser/inline/ok/0081_for_type.rast
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0081_for_type.rast
@@ -95,7 +95,7 @@ SOURCE_FILE@0..121
           PATH_SEGMENT@101..119
             NAME_REF@101..110
               IDENT@101..110 "PartialEq"
-            TYPE_ARG_LIST@110..119
+            GENERIC_ARG_LIST@110..119
               L_ANGLE@110..111 "<"
               TYPE_ARG@111..118
                 REFERENCE_TYPE@111..118
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0104_path_fn_trait_args.rast b/crates/ra_syntax/test_data/parser/inline/ok/0104_path_fn_trait_args.rast
index 3f53d60c09..1244a50313 100644
--- a/crates/ra_syntax/test_data/parser/inline/ok/0104_path_fn_trait_args.rast
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0104_path_fn_trait_args.rast
@@ -12,7 +12,7 @@ SOURCE_FILE@0..29
         PATH_SEGMENT@9..27
           NAME_REF@9..12
             IDENT@9..12 "Box"
-          TYPE_ARG_LIST@12..27
+          GENERIC_ARG_LIST@12..27
             L_ANGLE@12..13 "<"
             TYPE_ARG@13..26
               PATH_TYPE@13..26
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0107_method_call_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0107_method_call_expr.rast
index b2961b0ff1..be8365e057 100644
--- a/crates/ra_syntax/test_data/parser/inline/ok/0107_method_call_expr.rast
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0107_method_call_expr.rast
@@ -36,7 +36,7 @@ SOURCE_FILE@0..49
           DOT@29..30 "."
           NAME_REF@30..33
             IDENT@30..33 "bar"
-          TYPE_ARG_LIST@33..38
+          GENERIC_ARG_LIST@33..38
             COLON2@33..35 "::"
             L_ANGLE@35..36 "<"
             TYPE_ARG@36..37
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0138_associated_type_bounds.rast b/crates/ra_syntax/test_data/parser/inline/ok/0138_associated_type_bounds.rast
index 157513565d..e0a82df751 100644
--- a/crates/ra_syntax/test_data/parser/inline/ok/0138_associated_type_bounds.rast
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0138_associated_type_bounds.rast
@@ -18,7 +18,7 @@ SOURCE_FILE@0..59
                 PATH_SEGMENT@16..39
                   NAME_REF@16..24
                     IDENT@16..24 "Iterator"
-                  TYPE_ARG_LIST@24..39
+                  GENERIC_ARG_LIST@24..39
                     L_ANGLE@24..25 "<"
                     ASSOC_TYPE_ARG@25..38
                       NAME_REF@25..29
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0150_impl_type_params.rast b/crates/ra_syntax/test_data/parser/inline/ok/0150_impl_type_params.rast
index 8f197a19d5..12194abdaf 100644
--- a/crates/ra_syntax/test_data/parser/inline/ok/0150_impl_type_params.rast
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0150_impl_type_params.rast
@@ -22,7 +22,7 @@ SOURCE_FILE@0..29
         PATH_SEGMENT@19..25
           NAME_REF@19..22
             IDENT@19..22 "Bar"
-          TYPE_ARG_LIST@22..25
+          GENERIC_ARG_LIST@22..25
             L_ANGLE@22..23 "<"
             TYPE_ARG@23..24
               PATH_TYPE@23..24
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0151_trait_alias.rast b/crates/ra_syntax/test_data/parser/inline/ok/0151_trait_alias.rast
index cc220e5348..dac50410e4 100644
--- a/crates/ra_syntax/test_data/parser/inline/ok/0151_trait_alias.rast
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0151_trait_alias.rast
@@ -20,7 +20,7 @@ SOURCE_FILE@0..83
             PATH_SEGMENT@13..17
               NAME_REF@13..14
                 IDENT@13..14 "T"
-              TYPE_ARG_LIST@14..17
+              GENERIC_ARG_LIST@14..17
                 L_ANGLE@14..15 "<"
                 TYPE_ARG@15..16
                   PATH_TYPE@15..16
@@ -52,7 +52,7 @@ SOURCE_FILE@0..83
             PATH_SEGMENT@32..36
               NAME_REF@32..33
                 IDENT@32..33 "T"
-              TYPE_ARG_LIST@33..36
+              GENERIC_ARG_LIST@33..36
                 L_ANGLE@33..34 "<"
                 TYPE_ARG@34..35
                   PATH_TYPE@34..35
@@ -115,7 +115,7 @@ SOURCE_FILE@0..83
                 PATH_SEGMENT@77..81
                   NAME_REF@77..78
                     IDENT@77..78 "T"
-                  TYPE_ARG_LIST@78..81
+                  GENERIC_ARG_LIST@78..81
                     L_ANGLE@78..79 "<"
                     TYPE_ARG@79..80
                       PATH_TYPE@79..80
diff --git a/crates/ra_syntax/test_data/parser/ok/0032_where_for.rast b/crates/ra_syntax/test_data/parser/ok/0032_where_for.rast
index 10da87c71a..d59548f210 100644
--- a/crates/ra_syntax/test_data/parser/ok/0032_where_for.rast
+++ b/crates/ra_syntax/test_data/parser/ok/0032_where_for.rast
@@ -49,7 +49,7 @@ SOURCE_FILE@0..116
                   PATH_SEGMENT@65..81
                     NAME_REF@65..76
                       IDENT@65..76 "Deserialize"
-                    TYPE_ARG_LIST@76..81
+                    GENERIC_ARG_LIST@76..81
                       L_ANGLE@76..77 "<"
                       LIFETIME_ARG@77..80
                         LIFETIME@77..80 "\'de"
diff --git a/crates/ra_syntax/test_data/parser/ok/0035_weird_exprs.rast b/crates/ra_syntax/test_data/parser/ok/0035_weird_exprs.rast
index 1d75ed08f0..0e0c8c9dc3 100644
--- a/crates/ra_syntax/test_data/parser/ok/0035_weird_exprs.rast
+++ b/crates/ra_syntax/test_data/parser/ok/0035_weird_exprs.rast
@@ -249,7 +249,7 @@ SOURCE_FILE@0..3813
                   PATH_SEGMENT@653..663
                     NAME_REF@653..657
                       IDENT@653..657 "Cell"
-                    TYPE_ARG_LIST@657..663
+                    GENERIC_ARG_LIST@657..663
                       L_ANGLE@657..658 "<"
                       TYPE_ARG@658..662
                         PATH_TYPE@658..662
@@ -1588,7 +1588,7 @@ SOURCE_FILE@0..3813
                   PATH_SEGMENT@2888..2901
                     NAME_REF@2888..2893
                       IDENT@2888..2893 "union"
-                    TYPE_ARG_LIST@2893..2901
+                    GENERIC_ARG_LIST@2893..2901
                       L_ANGLE@2893..2894 "<"
                       LIFETIME_ARG@2894..2900
                         LIFETIME@2894..2900 "\'union"
diff --git a/crates/ra_syntax/test_data/parser/ok/0045_block_inner_attrs.rast b/crates/ra_syntax/test_data/parser/ok/0045_block_inner_attrs.rast
index 139ce90469..bd152ffa32 100644
--- a/crates/ra_syntax/test_data/parser/ok/0045_block_inner_attrs.rast
+++ b/crates/ra_syntax/test_data/parser/ok/0045_block_inner_attrs.rast
@@ -141,7 +141,7 @@ SOURCE_FILE@0..686
                               PATH_SEGMENT@589..600
                                 NAME_REF@589..594
                                   IDENT@589..594 "Event"
-                                TYPE_ARG_LIST@594..600
+                                GENERIC_ARG_LIST@594..600
                                   L_ANGLE@594..595 "<"
                                   TYPE_ARG@595..599
                                     PATH_TYPE@595..599
diff --git a/crates/ra_syntax/test_data/parser/ok/0050_async_block_as_argument.rast b/crates/ra_syntax/test_data/parser/ok/0050_async_block_as_argument.rast
index 798e81ca65..48e1f07d1d 100644
--- a/crates/ra_syntax/test_data/parser/ok/0050_async_block_as_argument.rast
+++ b/crates/ra_syntax/test_data/parser/ok/0050_async_block_as_argument.rast
@@ -32,7 +32,7 @@ SOURCE_FILE@0..95
                   PATH_SEGMENT@28..48
                     NAME_REF@28..34
                       IDENT@28..34 "Future"
-                    TYPE_ARG_LIST@34..48
+                    GENERIC_ARG_LIST@34..48
                       L_ANGLE@34..35 "<"
                       ASSOC_TYPE_ARG@35..47
                         NAME_REF@35..41
diff --git a/crates/ra_syntax/test_data/parser/ok/0051_parameter_attrs.rast b/crates/ra_syntax/test_data/parser/ok/0051_parameter_attrs.rast
index 2cc8497844..706ccdc391 100644
--- a/crates/ra_syntax/test_data/parser/ok/0051_parameter_attrs.rast
+++ b/crates/ra_syntax/test_data/parser/ok/0051_parameter_attrs.rast
@@ -172,7 +172,7 @@ SOURCE_FILE@0..519
                             PATH_SEGMENT@159..166
                               NAME_REF@159..162
                                 IDENT@159..162 "Foo"
-                              TYPE_ARG_LIST@162..166
+                              GENERIC_ARG_LIST@162..166
                                 L_ANGLE@162..163 "<"
                                 LIFETIME_ARG@163..165
                                   LIFETIME@163..165 "\'a"
@@ -490,7 +490,7 @@ SOURCE_FILE@0..519
                 PATH_SEGMENT@505..513
                   NAME_REF@505..507
                     IDENT@505..507 "Rc"
-                  TYPE_ARG_LIST@507..513
+                  GENERIC_ARG_LIST@507..513
                     L_ANGLE@507..508 "<"
                     TYPE_ARG@508..512
                       PATH_TYPE@508..512
diff --git a/crates/ra_syntax/test_data/parser/ok/0052_for_range_block.rast b/crates/ra_syntax/test_data/parser/ok/0052_for_range_block.rast
index a300003986..fd4f4f2422 100644
--- a/crates/ra_syntax/test_data/parser/ok/0052_for_range_block.rast
+++ b/crates/ra_syntax/test_data/parser/ok/0052_for_range_block.rast
@@ -50,7 +50,7 @@ SOURCE_FILE@0..80
             DOT@43..44 "."
             NAME_REF@44..47
               IDENT@44..47 "sum"
-            TYPE_ARG_LIST@47..54
+            GENERIC_ARG_LIST@47..54
               COLON2@47..49 "::"
               L_ANGLE@49..50 "<"
               TYPE_ARG@50..53
diff --git a/crates/ra_syntax/test_data/parser/ok/0054_qual_path_in_type_arg.rast b/crates/ra_syntax/test_data/parser/ok/0054_qual_path_in_type_arg.rast
index e3997ac5b8..0d48c7e81b 100644
--- a/crates/ra_syntax/test_data/parser/ok/0054_qual_path_in_type_arg.rast
+++ b/crates/ra_syntax/test_data/parser/ok/0054_qual_path_in_type_arg.rast
@@ -16,7 +16,7 @@ SOURCE_FILE@0..88
           PATH_SEGMENT@10..23
             NAME_REF@10..13
               IDENT@10..13 "Foo"
-            TYPE_ARG_LIST@13..23
+            GENERIC_ARG_LIST@13..23
               L_ANGLE@13..14 "<"
               TYPE_ARG@14..22
                 PATH_TYPE@14..22