resolve/expand: Improve attribute expansion on macro definitions and calls
This commit is contained in:
parent
46c35c76fe
commit
d81c1946c6
8 changed files with 63 additions and 40 deletions
|
@ -1543,13 +1543,8 @@ impl<'a, 'b> MutVisitor for InvocationCollector<'a, 'b> {
|
|||
}
|
||||
|
||||
fn visit_item_kind(&mut self, item: &mut ast::ItemKind) {
|
||||
match item {
|
||||
ast::ItemKind::MacroDef(..) => {}
|
||||
_ => {
|
||||
self.cfg.configure_item_kind(item);
|
||||
noop_visit_item_kind(item, self);
|
||||
}
|
||||
}
|
||||
self.cfg.configure_item_kind(item);
|
||||
noop_visit_item_kind(item, self);
|
||||
}
|
||||
|
||||
fn flat_map_generic_param(
|
||||
|
|
|
@ -258,12 +258,9 @@ impl<'a, 'b> MutVisitor for PlaceholderExpander<'a, 'b> {
|
|||
|
||||
fn flat_map_item(&mut self, item: P<ast::Item>) -> SmallVec<[P<ast::Item>; 1]> {
|
||||
match item.kind {
|
||||
ast::ItemKind::MacCall(_) => return self.remove(item.id).make_items(),
|
||||
ast::ItemKind::MacroDef(_) => return smallvec![item],
|
||||
_ => {}
|
||||
ast::ItemKind::MacCall(_) => self.remove(item.id).make_items(),
|
||||
_ => noop_flat_map_item(item, self),
|
||||
}
|
||||
|
||||
noop_flat_map_item(item, self)
|
||||
}
|
||||
|
||||
fn flat_map_trait_item(&mut self, item: P<ast::AssocItem>) -> SmallVec<[P<ast::AssocItem>; 1]> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue