From 2a5ab9f5ddc2f60a9229904c412ac943e894c4b7 Mon Sep 17 00:00:00 2001 From: veetaha Date: Sun, 10 May 2020 22:08:06 +0300 Subject: [PATCH] Resolve TODO about macro 2.0 def --- crates/ra_syntax/src/ast/generated/nodes.rs | 10 ++++------ xtask/src/ast_src.rs | 12 ++++-------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/crates/ra_syntax/src/ast/generated/nodes.rs b/crates/ra_syntax/src/ast/generated/nodes.rs index 201ceb5482..7ee4590ba9 100644 --- a/crates/ra_syntax/src/ast/generated/nodes.rs +++ b/crates/ra_syntax/src/ast/generated/nodes.rs @@ -2537,17 +2537,15 @@ impl MetaItem { pub fn attr_input(&self) -> Option { support::child(&self.syntax) } pub fn nested_meta_items(&self) -> AstChildren { support::children(&self.syntax) } } -/// Macro definition. -/// +/// Macro 2.0 definition. +/// Their syntax is still WIP by rustc team... /// ``` /// ❰ -/// macro_rules! foo { -/// ($bar:tt) => {$bar} -/// } +/// macro foo { } /// ❱ /// ``` /// -/// [Reference](https://doc.rust-lang.org/reference/macros-by-example.html) +/// [RFC](https://github.com/rust-lang/rfcs/blob/master/text/1584-macros.md) #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct MacroDef { pub(crate) syntax: SyntaxNode, diff --git a/xtask/src/ast_src.rs b/xtask/src/ast_src.rs index a7b0f2b05b..d1e34e2996 100644 --- a/xtask/src/ast_src.rs +++ b/xtask/src/ast_src.rs @@ -2049,19 +2049,15 @@ pub(crate) const AST_SRC: AstSrc = AstSrc { Path, T![=], AttrInput, nested_meta_items: [MetaItem] } - // TODO: is this a special case of `MacroCall` where `Name` = `macro_rules`? - // It doesn't seem this ast node is used anywhere - /// Macro definition. - /// + /// Macro 2.0 definition. + /// Their syntax is still WIP by rustc team... /// ``` /// ❰ - /// macro_rules! foo { - /// ($bar:tt) => {$bar} - /// } + /// macro foo { } /// ❱ /// ``` /// - /// [Reference](https://doc.rust-lang.org/reference/macros-by-example.html) + /// [RFC](https://github.com/rust-lang/rfcs/blob/master/text/1584-macros.md) struct MacroDef { Name, TokenTree }