aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/ast
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_syntax/src/ast')
-rw-r--r--crates/ra_syntax/src/ast/generated.rs73
1 files changed, 73 insertions, 0 deletions
diff --git a/crates/ra_syntax/src/ast/generated.rs b/crates/ra_syntax/src/ast/generated.rs
index 47a37e4d1..9ea423b40 100644
--- a/crates/ra_syntax/src/ast/generated.rs
+++ b/crates/ra_syntax/src/ast/generated.rs
@@ -685,6 +685,7 @@ impl ToOwned for DynTraitType {
685} 685}
686 686
687 687
688impl ast::TypeBoundsOwner for DynTraitType {}
688impl DynTraitType {} 689impl DynTraitType {}
689 690
690// EnumDef 691// EnumDef
@@ -1581,6 +1582,7 @@ impl ToOwned for ImplTraitType {
1581} 1582}
1582 1583
1583 1584
1585impl ast::TypeBoundsOwner for ImplTraitType {}
1584impl ImplTraitType {} 1586impl ImplTraitType {}
1585 1587
1586// IndexExpr 1588// IndexExpr
@@ -4061,6 +4063,7 @@ impl ast::NameOwner for TraitDef {}
4061impl ast::AttrsOwner for TraitDef {} 4063impl ast::AttrsOwner for TraitDef {}
4062impl ast::DocCommentsOwner for TraitDef {} 4064impl ast::DocCommentsOwner for TraitDef {}
4063impl ast::TypeParamsOwner for TraitDef {} 4065impl ast::TypeParamsOwner for TraitDef {}
4066impl ast::TypeBoundsOwner for TraitDef {}
4064impl TraitDef { 4067impl TraitDef {
4065 pub fn item_list(&self) -> Option<&ItemList> { 4068 pub fn item_list(&self) -> Option<&ItemList> {
4066 super::child_opt(self) 4069 super::child_opt(self)
@@ -4291,6 +4294,7 @@ impl ast::NameOwner for TypeAliasDef {}
4291impl ast::TypeParamsOwner for TypeAliasDef {} 4294impl ast::TypeParamsOwner for TypeAliasDef {}
4292impl ast::AttrsOwner for TypeAliasDef {} 4295impl ast::AttrsOwner for TypeAliasDef {}
4293impl ast::DocCommentsOwner for TypeAliasDef {} 4296impl ast::DocCommentsOwner for TypeAliasDef {}
4297impl ast::TypeBoundsOwner for TypeAliasDef {}
4294impl TypeAliasDef { 4298impl TypeAliasDef {
4295 pub fn type_ref(&self) -> Option<&TypeRef> { 4299 pub fn type_ref(&self) -> Option<&TypeRef> {
4296 super::child_opt(self) 4300 super::child_opt(self)
@@ -4369,6 +4373,74 @@ impl TypeArgList {
4369 } 4373 }
4370} 4374}
4371 4375
4376// TypeBound
4377#[derive(Debug, PartialEq, Eq, Hash)]
4378#[repr(transparent)]
4379pub struct TypeBound {
4380 pub(crate) syntax: SyntaxNode,
4381}
4382unsafe impl TransparentNewType for TypeBound {
4383 type Repr = rowan::SyntaxNode<RaTypes>;
4384}
4385
4386impl AstNode for TypeBound {
4387 fn cast(syntax: &SyntaxNode) -> Option<&Self> {
4388 match syntax.kind() {
4389 TYPE_BOUND => Some(TypeBound::from_repr(syntax.into_repr())),
4390 _ => None,
4391 }
4392 }
4393 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4394}
4395
4396impl ToOwned for TypeBound {
4397 type Owned = TreeArc<TypeBound>;
4398 fn to_owned(&self) -> TreeArc<TypeBound> { TreeArc::cast(self.syntax.to_owned()) }
4399}
4400
4401
4402impl TypeBound {
4403 pub fn type_ref(&self) -> Option<&TypeRef> {
4404 super::child_opt(self)
4405 }
4406
4407 pub fn lifetime(&self) -> Option<&Lifetime> {
4408 super::child_opt(self)
4409 }
4410}
4411
4412// TypeBoundList
4413#[derive(Debug, PartialEq, Eq, Hash)]
4414#[repr(transparent)]
4415pub struct TypeBoundList {
4416 pub(crate) syntax: SyntaxNode,
4417}
4418unsafe impl TransparentNewType for TypeBoundList {
4419 type Repr = rowan::SyntaxNode<RaTypes>;
4420}
4421
4422impl AstNode for TypeBoundList {
4423 fn cast(syntax: &SyntaxNode) -> Option<&Self> {
4424 match syntax.kind() {
4425 TYPE_BOUND_LIST => Some(TypeBoundList::from_repr(syntax.into_repr())),
4426 _ => None,
4427 }
4428 }
4429 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4430}
4431
4432impl ToOwned for TypeBoundList {
4433 type Owned = TreeArc<TypeBoundList>;
4434 fn to_owned(&self) -> TreeArc<TypeBoundList> { TreeArc::cast(self.syntax.to_owned()) }
4435}
4436
4437
4438impl TypeBoundList {
4439 pub fn bounds(&self) -> impl Iterator<Item = &TypeBound> {
4440 super::children(self)
4441 }
4442}
4443
4372// TypeParam 4444// TypeParam
4373#[derive(Debug, PartialEq, Eq, Hash)] 4445#[derive(Debug, PartialEq, Eq, Hash)]
4374#[repr(transparent)] 4446#[repr(transparent)]
@@ -4397,6 +4469,7 @@ impl ToOwned for TypeParam {
4397 4469
4398impl ast::NameOwner for TypeParam {} 4470impl ast::NameOwner for TypeParam {}
4399impl ast::AttrsOwner for TypeParam {} 4471impl ast::AttrsOwner for TypeParam {}
4472impl ast::TypeBoundsOwner for TypeParam {}
4400impl TypeParam {} 4473impl TypeParam {}
4401 4474
4402// TypeParamList 4475// TypeParamList