diff options
| author | Jeffrey Seyfried <jeffrey.seyfried@gmail.com> | 2016-09-13 05:21:54 +0000 |
|---|---|---|
| committer | Jeffrey Seyfried <jeffrey.seyfried@gmail.com> | 2016-09-15 20:57:54 +0000 |
| commit | 0ddb66c4c7216f43cccac8fa08b17abc98bd6c0b (patch) | |
| tree | bddcff72ee8d4e5de7466c1d831e7b5112099137 /src/libsyntax | |
| parent | 21ba8160f2aed7a2195015c5889c8a991181fe2f (diff) | |
| download | rust-0ddb66c4c7216f43cccac8fa08b17abc98bd6c0b.tar.gz rust-0ddb66c4c7216f43cccac8fa08b17abc98bd6c0b.zip | |
Allow `IdentMacroExpander::expand` to access the ident macro invocation's attributes.
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ext/base.rs | 6 | ||||
| -rw-r--r-- | 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 @@ pub trait IdentMacroExpander { cx: &'cx mut ExtCtxt, sp: Span, ident: ast::Ident, - token_tree: Vec<tokenstream::TokenTree> ) + token_tree: Vec<tokenstream::TokenTree>, + attrs: Vec<ast::Attribute>) -> Box<MacResult+'cx>; } @@ -193,7 +194,8 @@ impl<F> IdentMacroExpander for F cx: &'cx mut ExtCtxt, sp: Span, ident: ast::Ident, - token_tree: Vec<tokenstream::TokenTree> ) + token_tree: Vec<tokenstream::TokenTree>, + _attrs: Vec<ast::Attribute>) -> Box<MacResult+'cx> { (*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 @@ impl<'a, 'b> MacroExpander<'a, 'b> { } }); - kind.make_from(expander.expand(self.cx, span, ident, marked_tts)) + kind.make_from(expander.expand(self.cx, span, ident, marked_tts, attrs)) } MacroRulesTT => { |
