diff options
Diffstat (limited to 'crates/ra_syntax/src/ast')
-rw-r--r-- | crates/ra_syntax/src/ast/generated.rs | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/crates/ra_syntax/src/ast/generated.rs b/crates/ra_syntax/src/ast/generated.rs index 47a37e4d1..faf80bc32 100644 --- a/crates/ra_syntax/src/ast/generated.rs +++ b/crates/ra_syntax/src/ast/generated.rs | |||
@@ -4369,6 +4369,74 @@ impl TypeArgList { | |||
4369 | } | 4369 | } |
4370 | } | 4370 | } |
4371 | 4371 | ||
4372 | // TypeBound | ||
4373 | #[derive(Debug, PartialEq, Eq, Hash)] | ||
4374 | #[repr(transparent)] | ||
4375 | pub struct TypeBound { | ||
4376 | pub(crate) syntax: SyntaxNode, | ||
4377 | } | ||
4378 | unsafe impl TransparentNewType for TypeBound { | ||
4379 | type Repr = rowan::SyntaxNode<RaTypes>; | ||
4380 | } | ||
4381 | |||
4382 | impl AstNode for TypeBound { | ||
4383 | fn cast(syntax: &SyntaxNode) -> Option<&Self> { | ||
4384 | match syntax.kind() { | ||
4385 | TYPE_BOUND => Some(TypeBound::from_repr(syntax.into_repr())), | ||
4386 | _ => None, | ||
4387 | } | ||
4388 | } | ||
4389 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | ||
4390 | } | ||
4391 | |||
4392 | impl ToOwned for TypeBound { | ||
4393 | type Owned = TreeArc<TypeBound>; | ||
4394 | fn to_owned(&self) -> TreeArc<TypeBound> { TreeArc::cast(self.syntax.to_owned()) } | ||
4395 | } | ||
4396 | |||
4397 | |||
4398 | impl TypeBound { | ||
4399 | pub fn type_ref(&self) -> Option<&TypeRef> { | ||
4400 | super::child_opt(self) | ||
4401 | } | ||
4402 | |||
4403 | pub fn lifetime(&self) -> Option<&Lifetime> { | ||
4404 | super::child_opt(self) | ||
4405 | } | ||
4406 | } | ||
4407 | |||
4408 | // TypeBoundList | ||
4409 | #[derive(Debug, PartialEq, Eq, Hash)] | ||
4410 | #[repr(transparent)] | ||
4411 | pub struct TypeBoundList { | ||
4412 | pub(crate) syntax: SyntaxNode, | ||
4413 | } | ||
4414 | unsafe impl TransparentNewType for TypeBoundList { | ||
4415 | type Repr = rowan::SyntaxNode<RaTypes>; | ||
4416 | } | ||
4417 | |||
4418 | impl AstNode for TypeBoundList { | ||
4419 | fn cast(syntax: &SyntaxNode) -> Option<&Self> { | ||
4420 | match syntax.kind() { | ||
4421 | TYPE_BOUND_LIST => Some(TypeBoundList::from_repr(syntax.into_repr())), | ||
4422 | _ => None, | ||
4423 | } | ||
4424 | } | ||
4425 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | ||
4426 | } | ||
4427 | |||
4428 | impl ToOwned for TypeBoundList { | ||
4429 | type Owned = TreeArc<TypeBoundList>; | ||
4430 | fn to_owned(&self) -> TreeArc<TypeBoundList> { TreeArc::cast(self.syntax.to_owned()) } | ||
4431 | } | ||
4432 | |||
4433 | |||
4434 | impl TypeBoundList { | ||
4435 | pub fn bounds(&self) -> impl Iterator<Item = &TypeBound> { | ||
4436 | super::children(self) | ||
4437 | } | ||
4438 | } | ||
4439 | |||
4372 | // TypeParam | 4440 | // TypeParam |
4373 | #[derive(Debug, PartialEq, Eq, Hash)] | 4441 | #[derive(Debug, PartialEq, Eq, Hash)] |
4374 | #[repr(transparent)] | 4442 | #[repr(transparent)] |