@@ -3114,6 +3114,9 @@ impl TypeArgList {
31143114 pub fn assoc_type_args ( & self ) -> AstChildren < AssocTypeArg > {
31153115 AstChildren :: new ( & self . syntax )
31163116 }
3117+ pub fn const_arg ( & self ) -> AstChildren < ConstArg > {
3118+ AstChildren :: new ( & self . syntax )
3119+ }
31173120}
31183121#[ derive( Debug , Clone , PartialEq , Eq , Hash ) ]
31193122pub struct TypeArg {
@@ -3196,6 +3199,36 @@ impl AstNode for LifetimeArg {
31963199}
31973200impl LifetimeArg { }
31983201#[ derive( Debug , Clone , PartialEq , Eq , Hash ) ]
3202+ pub struct ConstArg {
3203+ pub ( crate ) syntax : SyntaxNode ,
3204+ }
3205+ impl AstNode for ConstArg {
3206+ fn can_cast ( kind : SyntaxKind ) -> bool {
3207+ match kind {
3208+ CONST_ARG => true ,
3209+ _ => false ,
3210+ }
3211+ }
3212+ fn cast ( syntax : SyntaxNode ) -> Option < Self > {
3213+ if Self :: can_cast ( syntax. kind ( ) ) {
3214+ Some ( Self { syntax } )
3215+ } else {
3216+ None
3217+ }
3218+ }
3219+ fn syntax ( & self ) -> & SyntaxNode {
3220+ & self . syntax
3221+ }
3222+ }
3223+ impl ConstArg {
3224+ pub fn literal ( & self ) -> Option < Literal > {
3225+ AstChildren :: new ( & self . syntax ) . next ( )
3226+ }
3227+ pub fn block_expr ( & self ) -> Option < BlockExpr > {
3228+ AstChildren :: new ( & self . syntax ) . next ( )
3229+ }
3230+ }
3231+ #[ derive( Debug , Clone , PartialEq , Eq , Hash ) ]
31993232pub struct MacroItems {
32003233 pub ( crate ) syntax : SyntaxNode ,
32013234}
0 commit comments