@@ -142,18 +142,6 @@ impl ConstArg {
142
142
pub fn expr ( & self ) -> Option < Expr > { support:: child ( & self . syntax ) }
143
143
}
144
144
145
- #[ derive( Debug , Clone , PartialEq , Eq , Hash ) ]
146
- pub struct ReturnTypeArg {
147
- pub ( crate ) syntax : SyntaxNode ,
148
- }
149
- impl ast:: HasTypeBounds for ReturnTypeArg { }
150
- impl ReturnTypeArg {
151
- pub fn name_ref ( & self ) -> Option < NameRef > { support:: child ( & self . syntax ) }
152
- pub fn l_paren_token ( & self ) -> Option < SyntaxToken > { support:: token ( & self . syntax , T ! [ '(' ] ) }
153
- pub fn dotdot_token ( & self ) -> Option < SyntaxToken > { support:: token ( & self . syntax , T ! [ ..] ) }
154
- pub fn r_paren_token ( & self ) -> Option < SyntaxToken > { support:: token ( & self . syntax , T ! [ ')' ] ) }
155
- }
156
-
157
145
#[ derive( Debug , Clone , PartialEq , Eq , Hash ) ]
158
146
pub struct TypeBoundList {
159
147
pub ( crate ) syntax : SyntaxNode ,
@@ -1528,7 +1516,6 @@ pub enum GenericArg {
1528
1516
AssocTypeArg ( AssocTypeArg ) ,
1529
1517
LifetimeArg ( LifetimeArg ) ,
1530
1518
ConstArg ( ConstArg ) ,
1531
- ReturnTypeArg ( ReturnTypeArg ) ,
1532
1519
}
1533
1520
1534
1521
#[ derive( Debug , Clone , PartialEq , Eq , Hash ) ]
@@ -1878,17 +1865,6 @@ impl AstNode for ConstArg {
1878
1865
}
1879
1866
fn syntax ( & self ) -> & SyntaxNode { & self . syntax }
1880
1867
}
1881
- impl AstNode for ReturnTypeArg {
1882
- fn can_cast ( kind : SyntaxKind ) -> bool { kind == RETURN_TYPE_ARG }
1883
- fn cast ( syntax : SyntaxNode ) -> Option < Self > {
1884
- if Self :: can_cast ( syntax. kind ( ) ) {
1885
- Some ( Self { syntax } )
1886
- } else {
1887
- None
1888
- }
1889
- }
1890
- fn syntax ( & self ) -> & SyntaxNode { & self . syntax }
1891
- }
1892
1868
impl AstNode for TypeBoundList {
1893
1869
fn can_cast ( kind : SyntaxKind ) -> bool { kind == TYPE_BOUND_LIST }
1894
1870
fn cast ( syntax : SyntaxNode ) -> Option < Self > {
@@ -3243,20 +3219,16 @@ impl From<LifetimeArg> for GenericArg {
3243
3219
impl From < ConstArg > for GenericArg {
3244
3220
fn from ( node : ConstArg ) -> GenericArg { GenericArg :: ConstArg ( node) }
3245
3221
}
3246
- impl From < ReturnTypeArg > for GenericArg {
3247
- fn from ( node : ReturnTypeArg ) -> GenericArg { GenericArg :: ReturnTypeArg ( node) }
3248
- }
3249
3222
impl AstNode for GenericArg {
3250
3223
fn can_cast ( kind : SyntaxKind ) -> bool {
3251
- matches ! ( kind, TYPE_ARG | ASSOC_TYPE_ARG | LIFETIME_ARG | CONST_ARG | RETURN_TYPE_ARG )
3224
+ matches ! ( kind, TYPE_ARG | ASSOC_TYPE_ARG | LIFETIME_ARG | CONST_ARG )
3252
3225
}
3253
3226
fn cast ( syntax : SyntaxNode ) -> Option < Self > {
3254
3227
let res = match syntax. kind ( ) {
3255
3228
TYPE_ARG => GenericArg :: TypeArg ( TypeArg { syntax } ) ,
3256
3229
ASSOC_TYPE_ARG => GenericArg :: AssocTypeArg ( AssocTypeArg { syntax } ) ,
3257
3230
LIFETIME_ARG => GenericArg :: LifetimeArg ( LifetimeArg { syntax } ) ,
3258
3231
CONST_ARG => GenericArg :: ConstArg ( ConstArg { syntax } ) ,
3259
- RETURN_TYPE_ARG => GenericArg :: ReturnTypeArg ( ReturnTypeArg { syntax } ) ,
3260
3232
_ => return None ,
3261
3233
} ;
3262
3234
Some ( res)
@@ -3267,7 +3239,6 @@ impl AstNode for GenericArg {
3267
3239
GenericArg :: AssocTypeArg ( it) => & it. syntax ,
3268
3240
GenericArg :: LifetimeArg ( it) => & it. syntax ,
3269
3241
GenericArg :: ConstArg ( it) => & it. syntax ,
3270
- GenericArg :: ReturnTypeArg ( it) => & it. syntax ,
3271
3242
}
3272
3243
}
3273
3244
}
@@ -4199,13 +4170,7 @@ impl AstNode for AnyHasTypeBounds {
4199
4170
fn can_cast ( kind : SyntaxKind ) -> bool {
4200
4171
matches ! (
4201
4172
kind,
4202
- ASSOC_TYPE_ARG
4203
- | RETURN_TYPE_ARG
4204
- | TRAIT
4205
- | TYPE_ALIAS
4206
- | LIFETIME_PARAM
4207
- | TYPE_PARAM
4208
- | WHERE_PRED
4173
+ ASSOC_TYPE_ARG | TRAIT | TYPE_ALIAS | LIFETIME_PARAM | TYPE_PARAM | WHERE_PRED
4209
4174
)
4210
4175
}
4211
4176
fn cast ( syntax : SyntaxNode ) -> Option < Self > {
@@ -4368,11 +4333,6 @@ impl std::fmt::Display for ConstArg {
4368
4333
std:: fmt:: Display :: fmt ( self . syntax ( ) , f)
4369
4334
}
4370
4335
}
4371
- impl std:: fmt:: Display for ReturnTypeArg {
4372
- fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
4373
- std:: fmt:: Display :: fmt ( self . syntax ( ) , f)
4374
- }
4375
- }
4376
4336
impl std:: fmt:: Display for TypeBoundList {
4377
4337
fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
4378
4338
std:: fmt:: Display :: fmt ( self . syntax ( ) , f)
0 commit comments