From 84cb4ad96994dd8a0dd0d8827834526b0184ca82 Mon Sep 17 00:00:00 2001 From: Nick Cameron Date: Wed, 8 Jul 2015 14:29:43 +1200 Subject: [PATCH] Fix a bug where macros in expression position don't have expansion inidices in their spans --- src/libsyntax/ext/expand.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index 4aa313f3e66..a4855ddcb25 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -60,14 +60,14 @@ fn push_compiler_expansion(fld: &mut MacroExpander, span: Span, expansion_desc: }; // Keep going, outside-in. - // let fully_expanded = fld.fold_expr(expanded_expr); + let span = fld.new_span(span); fld.cx.bt_pop(); fully_expanded.map(|e| ast::Expr { id: ast::DUMMY_NODE_ID, node: e.node, - span: fld.new_span(span), + span: span, }) } @@ -367,7 +367,8 @@ fn push_compiler_expansion(fld: &mut MacroExpander, span: Span, expansion_desc: /// of expansion and the mark which must be applied to the result. /// Our current interface doesn't allow us to apply the mark to the /// result until after calling make_expr, make_items, etc. -fn expand_mac_invoc(mac: ast::Mac, span: codemap::Span, +fn expand_mac_invoc(mac: ast::Mac, + span: codemap::Span, parse_thunk: F, mark_thunk: G, fld: &mut MacroExpander) -- 2.44.0