diff options
| author | bors <bors@rust-lang.org> | 2016-07-16 06:34:01 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-07-16 06:34:01 -0700 |
| commit | eb196dc2fffe0c992959ed99827654c2adcebe33 (patch) | |
| tree | b409f07a1daf8e2c7aa0e0b62305354e45e7c6d5 /src/libsyntax/ext | |
| parent | dc8212ff200dc54113a87b3a7033879133fdfff0 (diff) | |
| parent | 11f24a93c79a5ff5ecd2c238c603bdab30926bb3 (diff) | |
| download | rust-eb196dc2fffe0c992959ed99827654c2adcebe33.tar.gz rust-eb196dc2fffe0c992959ed99827654c2adcebe33.zip | |
Auto merge of #34816 - jseyfried:fix_include_path, r=nrc
Fix `include!()`s inside `asm!()` invocations Fixes #34812, a regression caused by #33749 that was not fixed in #34450. r? @nrc
Diffstat (limited to 'src/libsyntax/ext')
| -rw-r--r-- | src/libsyntax/ext/base.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs index 7ebcd12cdb9..ca2be89def0 100644 --- a/src/libsyntax/ext/base.rs +++ b/src/libsyntax/ext/base.rs @@ -816,6 +816,12 @@ impl<'a> ExtCtxt<'a> { /// compilation on error, merely emits a non-fatal error and returns None. pub fn expr_to_string(cx: &mut ExtCtxt, expr: P<ast::Expr>, err_msg: &str) -> Option<(InternedString, ast::StrStyle)> { + // Update `expr.span`'s expn_id now in case expr is an `include!` macro invocation. + let expr = expr.map(|mut expr| { + expr.span.expn_id = cx.backtrace; + expr + }); + // we want to be able to handle e.g. concat("foo", "bar") let expr = cx.expander().fold_expr(expr); match expr.node { |
