Skip to content

Commit 0d29142

Browse files
committed
expand: expand_fragment -> fully_expand_fragment
1 parent 60960a2 commit 0d29142

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/libsyntax/ext/expand.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,13 @@ macro_rules! ast_fragments {
118118

119119
impl<'a, 'b> MutVisitor for MacroExpander<'a, 'b> {
120120
fn filter_map_expr(&mut self, expr: P<ast::Expr>) -> Option<P<ast::Expr>> {
121-
self.expand_fragment(AstFragment::OptExpr(Some(expr))).make_opt_expr()
121+
self.fully_expand_fragment(AstFragment::OptExpr(Some(expr))).make_opt_expr()
122122
}
123123
$($(fn $mut_visit_ast(&mut self, ast: &mut $AstTy) {
124-
visit_clobber(ast, |ast| self.expand_fragment(AstFragment::$Kind(ast)).$make_ast());
124+
visit_clobber(ast, |ast| self.fully_expand_fragment(AstFragment::$Kind(ast)).$make_ast());
125125
})?)*
126126
$($(fn $flat_map_ast_elt(&mut self, ast_elt: <$AstTy as IntoIterator>::Item) -> $AstTy {
127-
self.expand_fragment(AstFragment::$Kind(smallvec![ast_elt])).$make_ast()
127+
self.fully_expand_fragment(AstFragment::$Kind(smallvec![ast_elt])).$make_ast()
128128
})?)*
129129
}
130130

@@ -265,7 +265,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
265265
tokens: None,
266266
})]);
267267

268-
match self.expand_fragment(krate_item).make_items().pop().map(P::into_inner) {
268+
match self.fully_expand_fragment(krate_item).make_items().pop().map(P::into_inner) {
269269
Some(ast::Item { attrs, node: ast::ItemKind::Mod(module), .. }) => {
270270
krate.attrs = attrs;
271271
krate.module = module;
@@ -285,8 +285,8 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
285285
krate
286286
}
287287

288-
// Fully expand all macro invocations in this AST fragment.
289-
fn expand_fragment(&mut self, input_fragment: AstFragment) -> AstFragment {
288+
// Recursively expand all macro invocations in this AST fragment.
289+
fn fully_expand_fragment(&mut self, input_fragment: AstFragment) -> AstFragment {
290290
let orig_expansion_data = self.cx.current_expansion.clone();
291291
self.cx.current_expansion.depth = 0;
292292

0 commit comments

Comments
 (0)