Skip to content

Commit 525ae70

Browse files
bors[bot]matklad
andauthored
Merge #5570
5570: Dead code r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
2 parents 9110e3b + 0d1357b commit 525ae70

File tree

2 files changed

+0
-49
lines changed

2 files changed

+0
-49
lines changed

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

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1710,7 +1710,6 @@ pub struct RecordFieldPatList {
17101710
}
17111711
impl RecordFieldPatList {
17121712
pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) }
1713-
pub fn pats(&self) -> AstChildren<RecordInnerPat> { support::children(&self.syntax) }
17141713
pub fn record_field_pats(&self) -> AstChildren<RecordFieldPat> {
17151714
support::children(&self.syntax)
17161715
}
@@ -2721,13 +2720,6 @@ pub enum Pat {
27212720
LiteralPat(LiteralPat),
27222721
MacroPat(MacroPat),
27232722
}
2724-
/// Any kind of pattern that appears directly inside of the curly
2725-
/// braces of a record pattern
2726-
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
2727-
pub enum RecordInnerPat {
2728-
RecordFieldPat(RecordFieldPat),
2729-
BindPat(BindPat),
2730-
}
27312723
/// Any kind of input to an attribute
27322724
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
27332725
pub enum AttrInput {
@@ -4693,34 +4685,6 @@ impl AstNode for Pat {
46934685
}
46944686
}
46954687
}
4696-
impl From<RecordFieldPat> for RecordInnerPat {
4697-
fn from(node: RecordFieldPat) -> RecordInnerPat { RecordInnerPat::RecordFieldPat(node) }
4698-
}
4699-
impl From<BindPat> for RecordInnerPat {
4700-
fn from(node: BindPat) -> RecordInnerPat { RecordInnerPat::BindPat(node) }
4701-
}
4702-
impl AstNode for RecordInnerPat {
4703-
fn can_cast(kind: SyntaxKind) -> bool {
4704-
match kind {
4705-
RECORD_FIELD_PAT | BIND_PAT => true,
4706-
_ => false,
4707-
}
4708-
}
4709-
fn cast(syntax: SyntaxNode) -> Option<Self> {
4710-
let res = match syntax.kind() {
4711-
RECORD_FIELD_PAT => RecordInnerPat::RecordFieldPat(RecordFieldPat { syntax }),
4712-
BIND_PAT => RecordInnerPat::BindPat(BindPat { syntax }),
4713-
_ => return None,
4714-
};
4715-
Some(res)
4716-
}
4717-
fn syntax(&self) -> &SyntaxNode {
4718-
match self {
4719-
RecordInnerPat::RecordFieldPat(it) => &it.syntax,
4720-
RecordInnerPat::BindPat(it) => &it.syntax,
4721-
}
4722-
}
4723-
}
47244688
impl From<Literal> for AttrInput {
47254689
fn from(node: Literal) -> AttrInput { AttrInput::Literal(node) }
47264690
}
@@ -4847,11 +4811,6 @@ impl std::fmt::Display for Pat {
48474811
std::fmt::Display::fmt(self.syntax(), f)
48484812
}
48494813
}
4850-
impl std::fmt::Display for RecordInnerPat {
4851-
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4852-
std::fmt::Display::fmt(self.syntax(), f)
4853-
}
4854-
}
48554814
impl std::fmt::Display for AttrInput {
48564815
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
48574816
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
@@ -1479,7 +1479,6 @@ pub(crate) fn rust_ast() -> AstSrc {
14791479
/// [Reference](https://doc.rust-lang.org/reference/patterns.html#struct-patterns)
14801480
struct RecordFieldPatList {
14811481
T!['{'],
1482-
pats: [RecordInnerPat],
14831482
record_field_pats: [RecordFieldPat],
14841483
bind_pats: [BindPat],
14851484
T![..],
@@ -2213,13 +2212,6 @@ pub(crate) fn rust_ast() -> AstSrc {
22132212
MacroPat,
22142213
}
22152214

2216-
/// Any kind of pattern that appears directly inside of the curly
2217-
/// braces of a record pattern
2218-
enum RecordInnerPat {
2219-
RecordFieldPat,
2220-
BindPat
2221-
}
2222-
22232215
/// Any kind of input to an attribute
22242216
enum AttrInput { Literal, TokenTree }
22252217

0 commit comments

Comments
 (0)