aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-07-29 14:12:43 +0100
committerGitHub <[email protected]>2020-07-29 14:12:43 +0100
commitb9c21078c5d738c12c9ae33491414b06907ebb48 (patch)
tree631c3a685be6d15eaa868d89185770814ee21ca1
parente35804355797a50195718918efc6f7272786d62e (diff)
parentdc18ff51c38a9e602832508f4a3676176dbe113d (diff)
Merge #5568
5568: Remove dead code r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
-rw-r--r--crates/ra_syntax/src/ast/generated/nodes.rs46
-rw-r--r--xtask/src/ast_src.rs8
2 files changed, 0 insertions, 54 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)
diff --git a/xtask/src/ast_src.rs b/xtask/src/ast_src.rs
index 425814d73..8d1ffc5b5 100644
--- a/xtask/src/ast_src.rs
+++ b/xtask/src/ast_src.rs
@@ -1630,7 +1630,6 @@ pub(crate) fn rust_ast() -> AstSrc {
1630 /// [Reference](https://doc.rust-lang.org/reference/items/generics.html) 1630 /// [Reference](https://doc.rust-lang.org/reference/items/generics.html)
1631 struct TypeParamList { 1631 struct TypeParamList {
1632 T![<], 1632 T![<],
1633 generic_params: [GenericParam],
1634 type_params: [TypeParam], 1633 type_params: [TypeParam],
1635 lifetime_params: [LifetimeParam], 1634 lifetime_params: [LifetimeParam],
1636 const_params: [ConstParam], 1635 const_params: [ConstParam],
@@ -2102,13 +2101,6 @@ pub(crate) fn rust_ast() -> AstSrc {
2102 StructDef, EnumDef, UnionDef, 2101 StructDef, EnumDef, UnionDef,
2103 } 2102 }
2104 2103
2105 /// Any kind of **declared** generic parameter
2106 enum GenericParam {
2107 LifetimeParam,
2108 TypeParam,
2109 ConstParam
2110 }
2111
2112 /// Any kind of generic argument passed at instantiation site 2104 /// Any kind of generic argument passed at instantiation site
2113 enum GenericArg { 2105 enum GenericArg {
2114 LifetimeArg, 2106 LifetimeArg,