diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-07-29 14:12:43 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-07-29 14:12:43 +0100 |
commit | b9c21078c5d738c12c9ae33491414b06907ebb48 (patch) | |
tree | 631c3a685be6d15eaa868d89185770814ee21ca1 /crates/ra_syntax/src | |
parent | e35804355797a50195718918efc6f7272786d62e (diff) | |
parent | dc18ff51c38a9e602832508f4a3676176dbe113d (diff) |
Merge #5568
5568: Remove dead code r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_syntax/src')
-rw-r--r-- | crates/ra_syntax/src/ast/generated/nodes.rs | 46 |
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 | } |
1930 | impl TypeParamList { | 1930 | impl 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 { | |||
2601 | impl ast::NameOwner for NominalDef {} | 2600 | impl ast::NameOwner for NominalDef {} |
2602 | impl ast::TypeParamsOwner for NominalDef {} | 2601 | impl ast::TypeParamsOwner for NominalDef {} |
2603 | impl ast::AttrsOwner for NominalDef {} | 2602 | impl ast::AttrsOwner for NominalDef {} |
2604 | /// Any kind of **declared** generic parameter | ||
2605 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
2606 | pub 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)] |
2613 | pub enum GenericArg { | 2605 | pub enum GenericArg { |
@@ -4155,39 +4147,6 @@ impl AstNode for NominalDef { | |||
4155 | } | 4147 | } |
4156 | } | 4148 | } |
4157 | } | 4149 | } |
4158 | impl From<LifetimeParam> for GenericParam { | ||
4159 | fn from(node: LifetimeParam) -> GenericParam { GenericParam::LifetimeParam(node) } | ||
4160 | } | ||
4161 | impl From<TypeParam> for GenericParam { | ||
4162 | fn from(node: TypeParam) -> GenericParam { GenericParam::TypeParam(node) } | ||
4163 | } | ||
4164 | impl From<ConstParam> for GenericParam { | ||
4165 | fn from(node: ConstParam) -> GenericParam { GenericParam::ConstParam(node) } | ||
4166 | } | ||
4167 | impl 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 | } | ||
4191 | impl From<LifetimeArg> for GenericArg { | 4150 | impl 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 | } |
4858 | impl 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 | } | ||
4863 | impl std::fmt::Display for GenericArg { | 4817 | impl 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) |