diff options
| author | Nick Cameron <ncameron@mozilla.com> | 2015-07-08 14:29:43 +1200 |
|---|---|---|
| committer | Nick Cameron <ncameron@mozilla.com> | 2015-07-09 12:24:39 +1200 |
| commit | 84cb4ad96994dd8a0dd0d8827834526b0184ca82 (patch) | |
| tree | 326006cdcd3ebd6dde97cd014895b77058b973f5 /src/libsyntax/ext | |
| parent | 8ac0bce64eba7c3433a481d78b617baf62eaac47 (diff) | |
| download | rust-84cb4ad96994dd8a0dd0d8827834526b0184ca82.tar.gz rust-84cb4ad96994dd8a0dd0d8827834526b0184ca82.zip | |
Fix a bug where macros in expression position don't have expansion inidices in their spans
Diffstat (limited to 'src/libsyntax/ext')
| -rw-r--r-- | src/libsyntax/ext/expand.rs | 7 |
1 files 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 @@ pub fn expand_expr(e: P<ast::Expr>, fld: &mut MacroExpander) -> P<ast::Expr> { }; // 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 @@ pub fn expand_expr(e: P<ast::Expr>, fld: &mut MacroExpander) -> P<ast::Expr> { /// 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<T, F, G>(mac: ast::Mac, span: codemap::Span, +fn expand_mac_invoc<T, F, G>(mac: ast::Mac, + span: codemap::Span, parse_thunk: F, mark_thunk: G, fld: &mut MacroExpander) |
