Remove MacroStmts as per edwin0cheng

This commit is contained in:
veetaha 2020-05-10 19:11:22 +03:00
parent 258a3461b4
commit 7a49165f5d
2 changed files with 0 additions and 47 deletions

View file

@ -2469,22 +2469,6 @@ pub struct MacroItems {
} }
impl ast::ModuleItemOwner for MacroItems {} impl ast::ModuleItemOwner for MacroItems {}
impl MacroItems {} impl MacroItems {}
/// Macro statements is a node that holds an statements created by expanding a macro.
///
/// ```
/// foo!(); // expands into some statements -v
/// // ❰ foo_crate::bar(); ❱
/// ```
///
/// [Reference](https://doc.rust-lang.org/reference/macros.html)
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct MacroStmts {
pub(crate) syntax: SyntaxNode,
}
impl MacroStmts {
pub fn statements(&self) -> AstChildren<Stmt> { support::children(&self.syntax) }
pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
}
/// List of items in an extern block. /// List of items in an extern block.
/// ///
/// ``` /// ```
@ -4041,17 +4025,6 @@ impl AstNode for MacroItems {
} }
fn syntax(&self) -> &SyntaxNode { &self.syntax } fn syntax(&self) -> &SyntaxNode { &self.syntax }
} }
impl AstNode for MacroStmts {
fn can_cast(kind: SyntaxKind) -> bool { kind == MACRO_STMTS }
fn cast(syntax: SyntaxNode) -> Option<Self> {
if Self::can_cast(syntax.kind()) {
Some(Self { syntax })
} else {
None
}
}
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl AstNode for ExternItemList { impl AstNode for ExternItemList {
fn can_cast(kind: SyntaxKind) -> bool { kind == EXTERN_ITEM_LIST } fn can_cast(kind: SyntaxKind) -> bool { kind == EXTERN_ITEM_LIST }
fn cast(syntax: SyntaxNode) -> Option<Self> { fn cast(syntax: SyntaxNode) -> Option<Self> {
@ -5484,11 +5457,6 @@ impl std::fmt::Display for MacroItems {
std::fmt::Display::fmt(self.syntax(), f) std::fmt::Display::fmt(self.syntax(), f)
} }
} }
impl std::fmt::Display for MacroStmts {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
std::fmt::Display::fmt(self.syntax(), f)
}
}
impl std::fmt::Display for ExternItemList { impl std::fmt::Display for ExternItemList {
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)

View file

@ -2010,21 +2010,6 @@ pub(crate) const AST_SRC: AstSrc = AstSrc {
/// [Reference](https://doc.rust-lang.org/reference/macros.html) /// [Reference](https://doc.rust-lang.org/reference/macros.html)
struct MacroItems: ModuleItemOwner { } struct MacroItems: ModuleItemOwner { }
// TODO: Idk what I am writing here, please don't believe these words.
// TODO: clarify @matklad @edwin0cheng
/// Macro statements is a node that holds an statements created by expanding a macro.
///
/// ```
/// foo!(); // expands into some statements -v
/// // ❰ foo_crate::bar(); ❱
/// ```
///
/// [Reference](https://doc.rust-lang.org/reference/macros.html)
struct MacroStmts {
statements: [Stmt],
Expr,
}
/// List of items in an extern block. /// List of items in an extern block.
/// ///
/// ``` /// ```