aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/ast/generated
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_syntax/src/ast/generated')
-rw-r--r--crates/ra_syntax/src/ast/generated/nodes.rs46
1 files changed, 0 insertions, 46 deletions
diff --git a/crates/ra_syntax/src/ast/generated/nodes.rs b/crates/ra_syntax/src/ast/generated/nodes.rs
index 58141da11..01508ed88 100644
--- a/crates/ra_syntax/src/ast/generated/nodes.rs
+++ b/crates/ra_syntax/src/ast/generated/nodes.rs
@@ -1929,7 +1929,6 @@ pub struct TypeParamList {
1929} 1929}
1930impl TypeParamList { 1930impl TypeParamList {
1931 pub fn l_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![<]) } 1931 pub fn l_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![<]) }
1932 pub fn generic_params(&self) -> AstChildren<GenericParam> { support::children(&self.syntax) }
1933 pub fn type_params(&self) -> AstChildren<TypeParam> { support::children(&self.syntax) } 1932 pub fn type_params(&self) -> AstChildren<TypeParam> { support::children(&self.syntax) }
1934 pub fn lifetime_params(&self) -> AstChildren<LifetimeParam> { support::children(&self.syntax) } 1933 pub fn lifetime_params(&self) -> AstChildren<LifetimeParam> { support::children(&self.syntax) }
1935 pub fn const_params(&self) -> AstChildren<ConstParam> { support::children(&self.syntax) } 1934 pub fn const_params(&self) -> AstChildren<ConstParam> { support::children(&self.syntax) }
@@ -2601,13 +2600,6 @@ pub enum NominalDef {
2601impl ast::NameOwner for NominalDef {} 2600impl ast::NameOwner for NominalDef {}
2602impl ast::TypeParamsOwner for NominalDef {} 2601impl ast::TypeParamsOwner for NominalDef {}
2603impl ast::AttrsOwner for NominalDef {} 2602impl ast::AttrsOwner for NominalDef {}
2604/// Any kind of **declared** generic parameter
2605#[derive(Debug, Clone, PartialEq, Eq, Hash)]
2606pub enum GenericParam {
2607 LifetimeParam(LifetimeParam),
2608 TypeParam(TypeParam),
2609 ConstParam(ConstParam),
2610}
2611/// Any kind of generic argument passed at instantiation site 2603/// Any kind of generic argument passed at instantiation site
2612#[derive(Debug, Clone, PartialEq, Eq, Hash)] 2604#[derive(Debug, Clone, PartialEq, Eq, Hash)]
2613pub enum GenericArg { 2605pub enum GenericArg {
@@ -4155,39 +4147,6 @@ impl AstNode for NominalDef {
4155 } 4147 }
4156 } 4148 }
4157} 4149}
4158impl From<LifetimeParam> for GenericParam {
4159 fn from(node: LifetimeParam) -> GenericParam { GenericParam::LifetimeParam(node) }
4160}
4161impl From<TypeParam> for GenericParam {
4162 fn from(node: TypeParam) -> GenericParam { GenericParam::TypeParam(node) }
4163}
4164impl From<ConstParam> for GenericParam {
4165 fn from(node: ConstParam) -> GenericParam { GenericParam::ConstParam(node) }
4166}
4167impl AstNode for GenericParam {
4168 fn can_cast(kind: SyntaxKind) -> bool {
4169 match kind {
4170 LIFETIME_PARAM | TYPE_PARAM | CONST_PARAM => true,
4171 _ => false,
4172 }
4173 }
4174 fn cast(syntax: SyntaxNode) -> Option<Self> {
4175 let res = match syntax.kind() {
4176 LIFETIME_PARAM => GenericParam::LifetimeParam(LifetimeParam { syntax }),
4177 TYPE_PARAM => GenericParam::TypeParam(TypeParam { syntax }),
4178 CONST_PARAM => GenericParam::ConstParam(ConstParam { syntax }),
4179 _ => return None,
4180 };
4181 Some(res)
4182 }
4183 fn syntax(&self) -> &SyntaxNode {
4184 match self {
4185 GenericParam::LifetimeParam(it) => &it.syntax,
4186 GenericParam::TypeParam(it) => &it.syntax,
4187 GenericParam::ConstParam(it) => &it.syntax,
4188 }
4189 }
4190}
4191impl From<LifetimeArg> for GenericArg { 4150impl From<LifetimeArg> for GenericArg {
4192 fn from(node: LifetimeArg) -> GenericArg { GenericArg::LifetimeArg(node) } 4151 fn from(node: LifetimeArg) -> GenericArg { GenericArg::LifetimeArg(node) }
4193} 4152}
@@ -4855,11 +4814,6 @@ impl std::fmt::Display for NominalDef {
4855 std::fmt::Display::fmt(self.syntax(), f) 4814 std::fmt::Display::fmt(self.syntax(), f)
4856 } 4815 }
4857} 4816}
4858impl std::fmt::Display for GenericParam {
4859 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4860 std::fmt::Display::fmt(self.syntax(), f)
4861 }
4862}
4863impl std::fmt::Display for GenericArg { 4817impl std::fmt::Display for GenericArg {
4864 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 4818 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4865 std::fmt::Display::fmt(self.syntax(), f) 4819 std::fmt::Display::fmt(self.syntax(), f)