Skip to content

Commit 8be8cf8

Browse files
committed
Refactor away expand_item.
1 parent fca80c9 commit 8be8cf8

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/libsyntax/ext/expand.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -345,10 +345,6 @@ fn expand_bang_invoc(invoc: Invocation, fld: &mut MacroExpander) -> Expansion {
345345
fully_expanded
346346
}
347347

348-
pub fn expand_item(it: P<ast::Item>, fld: &mut MacroExpander) -> SmallVector<P<ast::Item>> {
349-
expand_annotatable(Annotatable::Item(it), fld).make_items()
350-
}
351-
352348
// does this attribute list contain "macro_use" ?
353349
fn contains_macro_use(fld: &mut MacroExpander, attrs: &[ast::Attribute]) -> bool {
354350
for attr in attrs {
@@ -649,7 +645,7 @@ impl<'a, 'b> Folder for MacroExpander<'a, 'b> {
649645
::attr::first_attr_value_str_by_name(&item.attrs, "path")
650646
.unwrap_or(item.ident.name.as_str())
651647
});
652-
result = expand_item(item, self);
648+
result = expand_annotatable(Annotatable::Item(item), self).make_items();
653649
self.cx.directory = directory;
654650
} else {
655651
let mut directory = match inner {
@@ -658,11 +654,11 @@ impl<'a, 'b> Folder for MacroExpander<'a, 'b> {
658654
};
659655
directory.pop();
660656
let directory = replace(&mut self.cx.directory, directory);
661-
result = expand_item(item, self);
657+
result = expand_annotatable(Annotatable::Item(item), self).make_items();
662658
self.cx.directory = directory;
663659
}
664660
} else {
665-
result = expand_item(item, self);
661+
result = expand_annotatable(Annotatable::Item(item), self).make_items();
666662
}
667663
result
668664
}

0 commit comments

Comments
 (0)