diff options
| author | bors <bors@rust-lang.org> | 2016-06-26 14:50:27 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-06-26 14:50:27 -0700 |
| commit | 3059bb9e38bfd3e7862bda930dd20959a47a768e (patch) | |
| tree | bac0e1ab4f78250a1097c1344b28482ecc3a2a84 /src/libsyntax | |
| parent | 15e8a67c47dc624cc7de67dfa8020a1daefc5067 (diff) | |
| parent | e4885565a57be071327669125079465c6f1b5305 (diff) | |
| download | rust-3059bb9e38bfd3e7862bda930dd20959a47a768e.tar.gz rust-3059bb9e38bfd3e7862bda930dd20959a47a768e.zip | |
Auto merge of #34450 - jseyfried:fix_include_path, r=nrc
Revert a change to the relative path for macro-expanded `include!`s Fixes #34431 (c.f. discussion in that issue). r? @nrc
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ext/source_util.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libsyntax/ext/source_util.rs b/src/libsyntax/ext/source_util.rs index fd229d77966..d297188a35c 100644 --- a/src/libsyntax/ext/source_util.rs +++ b/src/libsyntax/ext/source_util.rs @@ -197,7 +197,8 @@ pub fn expand_include_bytes(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree]) fn res_rel_file(cx: &mut ExtCtxt, sp: codemap::Span, arg: &Path) -> PathBuf { // NB: relative paths are resolved relative to the compilation unit if !arg.is_absolute() { - let mut cu = PathBuf::from(&cx.codemap().span_to_filename(sp)); + let callsite = cx.codemap().source_callsite(sp); + let mut cu = PathBuf::from(&cx.codemap().span_to_filename(callsite)); cu.pop(); cu.push(arg); cu |
