Allow IdentMacroExpander::expand
to access the ident macro invocation's attributes.
This commit is contained in:
parent
21ba8160f2
commit
0ddb66c4c7
2 changed files with 5 additions and 3 deletions
|
@ -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)
|
||||
|
|
|
@ -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 => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue