From 0ddb66c4c7216f43cccac8fa08b17abc98bd6c0b Mon Sep 17 00:00:00 2001 From: Jeffrey Seyfried Date: Tue, 13 Sep 2016 05:21:54 +0000 Subject: [PATCH] Allow `IdentMacroExpander::expand` to access the ident macro invocation's attributes. --- src/libsyntax/ext/base.rs | 6 ++++-- src/libsyntax/ext/expand.rs | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs index fb4816d3847..ede17f8b005 100644 --- a/src/libsyntax/ext/base.rs +++ b/src/libsyntax/ext/base.rs @@ -177,7 +177,8 @@ fn expand<'cx>(&self, cx: &'cx mut ExtCtxt, sp: Span, ident: ast::Ident, - token_tree: Vec ) + token_tree: Vec, + attrs: Vec) -> Box; } @@ -193,7 +194,8 @@ fn expand<'cx>(&self, cx: &'cx mut ExtCtxt, sp: Span, ident: ast::Ident, - token_tree: Vec ) + token_tree: Vec, + _attrs: Vec) -> Box { (*self)(cx, sp, ident, token_tree) diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index eab59d3c930..9ea3ec3cccf 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -374,7 +374,7 @@ fn expand_bang_invoc(&mut self, invoc: Invocation, ext: Rc) -> } }); - kind.make_from(expander.expand(self.cx, span, ident, marked_tts)) + kind.make_from(expander.expand(self.cx, span, ident, marked_tts, attrs)) } MacroRulesTT => { -- GitLab