mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 13:03:31 +00:00
Merge #5570
5570: Dead code r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
commit
525ae706b3
2 changed files with 0 additions and 49 deletions
|
@ -1710,7 +1710,6 @@ pub struct RecordFieldPatList {
|
||||||
}
|
}
|
||||||
impl RecordFieldPatList {
|
impl RecordFieldPatList {
|
||||||
pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) }
|
pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) }
|
||||||
pub fn pats(&self) -> AstChildren<RecordInnerPat> { support::children(&self.syntax) }
|
|
||||||
pub fn record_field_pats(&self) -> AstChildren<RecordFieldPat> {
|
pub fn record_field_pats(&self) -> AstChildren<RecordFieldPat> {
|
||||||
support::children(&self.syntax)
|
support::children(&self.syntax)
|
||||||
}
|
}
|
||||||
|
@ -2721,13 +2720,6 @@ pub enum Pat {
|
||||||
LiteralPat(LiteralPat),
|
LiteralPat(LiteralPat),
|
||||||
MacroPat(MacroPat),
|
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
|
/// Any kind of input to an attribute
|
||||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||||
pub enum AttrInput {
|
pub enum AttrInput {
|
||||||
|
@ -4693,34 +4685,6 @@ impl AstNode for Pat {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
impl From<RecordFieldPat> for RecordInnerPat {
|
|
||||||
fn from(node: RecordFieldPat) -> RecordInnerPat { RecordInnerPat::RecordFieldPat(node) }
|
|
||||||
}
|
|
||||||
impl From<BindPat> 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<Self> {
|
|
||||||
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<Literal> for AttrInput {
|
impl From<Literal> for AttrInput {
|
||||||
fn from(node: Literal) -> AttrInput { AttrInput::Literal(node) }
|
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)
|
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 {
|
impl std::fmt::Display for AttrInput {
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
std::fmt::Display::fmt(self.syntax(), f)
|
std::fmt::Display::fmt(self.syntax(), f)
|
||||||
|
|
|
@ -1479,7 +1479,6 @@ pub(crate) fn rust_ast() -> AstSrc {
|
||||||
/// [Reference](https://doc.rust-lang.org/reference/patterns.html#struct-patterns)
|
/// [Reference](https://doc.rust-lang.org/reference/patterns.html#struct-patterns)
|
||||||
struct RecordFieldPatList {
|
struct RecordFieldPatList {
|
||||||
T!['{'],
|
T!['{'],
|
||||||
pats: [RecordInnerPat],
|
|
||||||
record_field_pats: [RecordFieldPat],
|
record_field_pats: [RecordFieldPat],
|
||||||
bind_pats: [BindPat],
|
bind_pats: [BindPat],
|
||||||
T![..],
|
T![..],
|
||||||
|
@ -2213,13 +2212,6 @@ pub(crate) fn rust_ast() -> AstSrc {
|
||||||
MacroPat,
|
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
|
/// Any kind of input to an attribute
|
||||||
enum AttrInput { Literal, TokenTree }
|
enum AttrInput { Literal, TokenTree }
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue