aboutsummaryrefslogtreecommitdiff
path: root/crates/libsyntax2/src/ast
diff options
context:
space:
mode:
Diffstat (limited to 'crates/libsyntax2/src/ast')
-rw-r--r--crates/libsyntax2/src/ast/generated.rs25
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> {}
580impl<'a> ast::AttrsOwner<'a> for TypeDef<'a> {} 580impl<'a> ast::AttrsOwner<'a> for TypeDef<'a> {}
581impl<'a> TypeDef<'a> {} 581impl<'a> TypeDef<'a> {}
582 582
583// TypeParam
584#[derive(Debug, Clone, Copy)]
585pub struct TypeParam<'a> {
586 syntax: SyntaxNodeRef<'a>,
587}
588
589impl<'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
599impl<'a> ast::NameOwner<'a> for TypeParam<'a> {}
600impl<'a> TypeParam<'a> {}
601
583// TypeParamList 602// TypeParamList
584#[derive(Debug, Clone, Copy)] 603#[derive(Debug, Clone, Copy)]
585pub struct TypeParamList<'a> { 604pub 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
599impl<'a> TypeParamList<'a> {} 618impl<'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)]