Skip to content

Commit b9c2107

Browse files
bors[bot]matklad
andauthored
Merge #5568
5568: Remove dead code r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
2 parents e358043 + dc18ff5 commit b9c2107

File tree

2 files changed

+0
-54
lines changed

2 files changed

+0
-54
lines changed

crates/ra_syntax/src/ast/generated/nodes.rs

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1929,7 +1929,6 @@ pub struct TypeParamList {
19291929
}
19301930
impl TypeParamList {
19311931
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) }
19331932
pub fn type_params(&self) -> AstChildren<TypeParam> { support::children(&self.syntax) }
19341933
pub fn lifetime_params(&self) -> AstChildren<LifetimeParam> { support::children(&self.syntax) }
19351934
pub fn const_params(&self) -> AstChildren<ConstParam> { support::children(&self.syntax) }
@@ -2601,13 +2600,6 @@ pub enum NominalDef {
26012600
impl ast::NameOwner for NominalDef {}
26022601
impl ast::TypeParamsOwner for NominalDef {}
26032602
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-
}
26112603
/// Any kind of generic argument passed at instantiation site
26122604
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
26132605
pub enum GenericArg {
@@ -4155,39 +4147,6 @@ impl AstNode for NominalDef {
41554147
}
41564148
}
41574149
}
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-
}
41914150
impl From<LifetimeArg> for GenericArg {
41924151
fn from(node: LifetimeArg) -> GenericArg { GenericArg::LifetimeArg(node) }
41934152
}
@@ -4855,11 +4814,6 @@ impl std::fmt::Display for NominalDef {
48554814
std::fmt::Display::fmt(self.syntax(), f)
48564815
}
48574816
}
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-
}
48634817
impl std::fmt::Display for GenericArg {
48644818
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
48654819
std::fmt::Display::fmt(self.syntax(), f)

xtask/src/ast_src.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1630,7 +1630,6 @@ pub(crate) fn rust_ast() -> AstSrc {
16301630
/// [Reference](https://doc.rust-lang.org/reference/items/generics.html)
16311631
struct TypeParamList {
16321632
T![<],
1633-
generic_params: [GenericParam],
16341633
type_params: [TypeParam],
16351634
lifetime_params: [LifetimeParam],
16361635
const_params: [ConstParam],
@@ -2102,13 +2101,6 @@ pub(crate) fn rust_ast() -> AstSrc {
21022101
StructDef, EnumDef, UnionDef,
21032102
}
21042103

2105-
/// Any kind of **declared** generic parameter
2106-
enum GenericParam {
2107-
LifetimeParam,
2108-
TypeParam,
2109-
ConstParam
2110-
}
2111-
21122104
/// Any kind of generic argument passed at instantiation site
21132105
enum GenericArg {
21142106
LifetimeArg,

0 commit comments

Comments
 (0)