From 0d1357be0515cf14bbca3577715b68794a7637b2 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 29 Jul 2020 17:35:05 +0200 Subject: [PATCH] Dead code --- crates/ra_syntax/src/ast/generated/nodes.rs | 41 --------------------- xtask/src/ast_src.rs | 8 ---- 2 files changed, 49 deletions(-) diff --git a/crates/ra_syntax/src/ast/generated/nodes.rs b/crates/ra_syntax/src/ast/generated/nodes.rs index df9b5cc2ce..1fe5f450a4 100644 --- a/crates/ra_syntax/src/ast/generated/nodes.rs +++ b/crates/ra_syntax/src/ast/generated/nodes.rs @@ -1710,7 +1710,6 @@ pub struct RecordFieldPatList { } impl RecordFieldPatList { pub fn l_curly_token(&self) -> Option { support::token(&self.syntax, T!['{']) } - pub fn pats(&self) -> AstChildren { support::children(&self.syntax) } pub fn record_field_pats(&self) -> AstChildren { support::children(&self.syntax) } @@ -2721,13 +2720,6 @@ pub enum Pat { LiteralPat(LiteralPat), MacroPat(MacroPat), } -/// Any kind of pattern that appears directly inside of the curly -/// braces of a record pattern -#[derive(Debug, Clone, PartialEq, Eq, Hash)] -pub enum RecordInnerPat { - RecordFieldPat(RecordFieldPat), - BindPat(BindPat), -} /// Any kind of input to an attribute #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum AttrInput { @@ -4693,34 +4685,6 @@ impl AstNode for Pat { } } } -impl From for RecordInnerPat { - fn from(node: RecordFieldPat) -> RecordInnerPat { RecordInnerPat::RecordFieldPat(node) } -} -impl From for RecordInnerPat { - fn from(node: BindPat) -> RecordInnerPat { RecordInnerPat::BindPat(node) } -} -impl AstNode for RecordInnerPat { - fn can_cast(kind: SyntaxKind) -> bool { - match kind { - RECORD_FIELD_PAT | BIND_PAT => true, - _ => false, - } - } - fn cast(syntax: SyntaxNode) -> Option { - let res = match syntax.kind() { - RECORD_FIELD_PAT => RecordInnerPat::RecordFieldPat(RecordFieldPat { syntax }), - BIND_PAT => RecordInnerPat::BindPat(BindPat { syntax }), - _ => return None, - }; - Some(res) - } - fn syntax(&self) -> &SyntaxNode { - match self { - RecordInnerPat::RecordFieldPat(it) => &it.syntax, - RecordInnerPat::BindPat(it) => &it.syntax, - } - } -} impl From for AttrInput { fn from(node: Literal) -> AttrInput { AttrInput::Literal(node) } } @@ -4847,11 +4811,6 @@ impl std::fmt::Display for Pat { std::fmt::Display::fmt(self.syntax(), f) } } -impl std::fmt::Display for RecordInnerPat { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - std::fmt::Display::fmt(self.syntax(), f) - } -} impl std::fmt::Display for AttrInput { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { std::fmt::Display::fmt(self.syntax(), f) diff --git a/xtask/src/ast_src.rs b/xtask/src/ast_src.rs index 7f0db31bdc..a6a4d7c355 100644 --- a/xtask/src/ast_src.rs +++ b/xtask/src/ast_src.rs @@ -1479,7 +1479,6 @@ pub(crate) fn rust_ast() -> AstSrc { /// [Reference](https://doc.rust-lang.org/reference/patterns.html#struct-patterns) struct RecordFieldPatList { T!['{'], - pats: [RecordInnerPat], record_field_pats: [RecordFieldPat], bind_pats: [BindPat], T![..], @@ -2213,13 +2212,6 @@ pub(crate) fn rust_ast() -> AstSrc { MacroPat, } - /// Any kind of pattern that appears directly inside of the curly - /// braces of a record pattern - enum RecordInnerPat { - RecordFieldPat, - BindPat - } - /// Any kind of input to an attribute enum AttrInput { Literal, TokenTree }