diff options
Diffstat (limited to 'crates/libsyntax2/src/ast')
-rw-r--r-- | crates/libsyntax2/src/ast/generated.rs | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/crates/libsyntax2/src/ast/generated.rs b/crates/libsyntax2/src/ast/generated.rs index 6df1d2311..5edb9faaa 100644 --- a/crates/libsyntax2/src/ast/generated.rs +++ b/crates/libsyntax2/src/ast/generated.rs | |||
@@ -580,6 +580,25 @@ impl<'a> ast::TypeParamsOwner<'a> for TypeDef<'a> {} | |||
580 | impl<'a> ast::AttrsOwner<'a> for TypeDef<'a> {} | 580 | impl<'a> ast::AttrsOwner<'a> for TypeDef<'a> {} |
581 | impl<'a> TypeDef<'a> {} | 581 | impl<'a> TypeDef<'a> {} |
582 | 582 | ||
583 | // TypeParam | ||
584 | #[derive(Debug, Clone, Copy)] | ||
585 | pub struct TypeParam<'a> { | ||
586 | syntax: SyntaxNodeRef<'a>, | ||
587 | } | ||
588 | |||
589 | impl<'a> AstNode<'a> for TypeParam<'a> { | ||
590 | fn cast(syntax: SyntaxNodeRef<'a>) -> Option<Self> { | ||
591 | match syntax.kind() { | ||
592 | TYPE_PARAM => Some(TypeParam { syntax }), | ||
593 | _ => None, | ||
594 | } | ||
595 | } | ||
596 | fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } | ||
597 | } | ||
598 | |||
599 | impl<'a> ast::NameOwner<'a> for TypeParam<'a> {} | ||
600 | impl<'a> TypeParam<'a> {} | ||
601 | |||
583 | // TypeParamList | 602 | // TypeParamList |
584 | #[derive(Debug, Clone, Copy)] | 603 | #[derive(Debug, Clone, Copy)] |
585 | pub struct TypeParamList<'a> { | 604 | pub struct TypeParamList<'a> { |
@@ -596,7 +615,11 @@ impl<'a> AstNode<'a> for TypeParamList<'a> { | |||
596 | fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } | 615 | fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } |
597 | } | 616 | } |
598 | 617 | ||
599 | impl<'a> TypeParamList<'a> {} | 618 | impl<'a> TypeParamList<'a> { |
619 | pub fn type_params(self) -> impl Iterator<Item = TypeParam<'a>> + 'a { | ||
620 | super::children(self) | ||
621 | } | ||
622 | } | ||
600 | 623 | ||
601 | // TypeRef | 624 | // TypeRef |
602 | #[derive(Debug, Clone, Copy)] | 625 | #[derive(Debug, Clone, Copy)] |