From dc18ff51c38a9e602832508f4a3676176dbe113d Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 29 Jul 2020 15:11:48 +0200 Subject: Remove dead code --- crates/ra_syntax/src/ast/generated/nodes.rs | 46 ----------------------------- 1 file changed, 46 deletions(-) (limited to 'crates/ra_syntax/src/ast') 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 { } impl TypeParamList { pub fn l_angle_token(&self) -> Option { support::token(&self.syntax, T![<]) } - pub fn generic_params(&self) -> AstChildren { support::children(&self.syntax) } pub fn type_params(&self) -> AstChildren { support::children(&self.syntax) } pub fn lifetime_params(&self) -> AstChildren { support::children(&self.syntax) } pub fn const_params(&self) -> AstChildren { support::children(&self.syntax) } @@ -2601,13 +2600,6 @@ pub enum NominalDef { impl ast::NameOwner for NominalDef {} impl ast::TypeParamsOwner for NominalDef {} impl ast::AttrsOwner for NominalDef {} -/// Any kind of **declared** generic parameter -#[derive(Debug, Clone, PartialEq, Eq, Hash)] -pub enum GenericParam { - LifetimeParam(LifetimeParam), - TypeParam(TypeParam), - ConstParam(ConstParam), -} /// Any kind of generic argument passed at instantiation site #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum GenericArg { @@ -4155,39 +4147,6 @@ impl AstNode for NominalDef { } } } -impl From for GenericParam { - fn from(node: LifetimeParam) -> GenericParam { GenericParam::LifetimeParam(node) } -} -impl From for GenericParam { - fn from(node: TypeParam) -> GenericParam { GenericParam::TypeParam(node) } -} -impl From for GenericParam { - fn from(node: ConstParam) -> GenericParam { GenericParam::ConstParam(node) } -} -impl AstNode for GenericParam { - fn can_cast(kind: SyntaxKind) -> bool { - match kind { - LIFETIME_PARAM | TYPE_PARAM | CONST_PARAM => true, - _ => false, - } - } - fn cast(syntax: SyntaxNode) -> Option { - let res = match syntax.kind() { - LIFETIME_PARAM => GenericParam::LifetimeParam(LifetimeParam { syntax }), - TYPE_PARAM => GenericParam::TypeParam(TypeParam { syntax }), - CONST_PARAM => GenericParam::ConstParam(ConstParam { syntax }), - _ => return None, - }; - Some(res) - } - fn syntax(&self) -> &SyntaxNode { - match self { - GenericParam::LifetimeParam(it) => &it.syntax, - GenericParam::TypeParam(it) => &it.syntax, - GenericParam::ConstParam(it) => &it.syntax, - } - } -} impl From for GenericArg { fn from(node: LifetimeArg) -> GenericArg { GenericArg::LifetimeArg(node) } } @@ -4855,11 +4814,6 @@ impl std::fmt::Display for NominalDef { std::fmt::Display::fmt(self.syntax(), f) } } -impl std::fmt::Display for GenericParam { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - std::fmt::Display::fmt(self.syntax(), f) - } -} impl std::fmt::Display for GenericArg { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { std::fmt::Display::fmt(self.syntax(), f) -- cgit v1.2.3