aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/ast/generated.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_syntax/src/ast/generated.rs')
-rw-r--r--crates/ra_syntax/src/ast/generated.rs43
1 files changed, 42 insertions, 1 deletions
diff --git a/crates/ra_syntax/src/ast/generated.rs b/crates/ra_syntax/src/ast/generated.rs
index 9ea423b40..c51b4caa4 100644
--- a/crates/ra_syntax/src/ast/generated.rs
+++ b/crates/ra_syntax/src/ast/generated.rs
@@ -4810,7 +4810,48 @@ impl ToOwned for WhereClause {
4810} 4810}
4811 4811
4812 4812
4813impl WhereClause {} 4813impl WhereClause {
4814 pub fn predicates(&self) -> impl Iterator<Item = &WherePred> {
4815 super::children(self)
4816 }
4817}
4818
4819// WherePred
4820#[derive(Debug, PartialEq, Eq, Hash)]
4821#[repr(transparent)]
4822pub struct WherePred {
4823 pub(crate) syntax: SyntaxNode,
4824}
4825unsafe impl TransparentNewType for WherePred {
4826 type Repr = rowan::SyntaxNode<RaTypes>;
4827}
4828
4829impl AstNode for WherePred {
4830 fn cast(syntax: &SyntaxNode) -> Option<&Self> {
4831 match syntax.kind() {
4832 WHERE_PRED => Some(WherePred::from_repr(syntax.into_repr())),
4833 _ => None,
4834 }
4835 }
4836 fn syntax(&self) -> &SyntaxNode { &self.syntax }
4837}
4838
4839impl ToOwned for WherePred {
4840 type Owned = TreeArc<WherePred>;
4841 fn to_owned(&self) -> TreeArc<WherePred> { TreeArc::cast(self.syntax.to_owned()) }
4842}
4843
4844
4845impl ast::TypeBoundsOwner for WherePred {}
4846impl WherePred {
4847 pub fn type_ref(&self) -> Option<&TypeRef> {
4848 super::child_opt(self)
4849 }
4850
4851 pub fn lifetime(&self) -> Option<&Lifetime> {
4852 super::child_opt(self)
4853 }
4854}
4814 4855
4815// WhileExpr 4856// WhileExpr
4816#[derive(Debug, PartialEq, Eq, Hash)] 4857#[derive(Debug, PartialEq, Eq, Hash)]