Revert a change to the relative path for macro-expanded include!s
This commit is contained in:
@@ -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 {
|
fn res_rel_file(cx: &mut ExtCtxt, sp: codemap::Span, arg: &Path) -> PathBuf {
|
||||||
// NB: relative paths are resolved relative to the compilation unit
|
// NB: relative paths are resolved relative to the compilation unit
|
||||||
if !arg.is_absolute() {
|
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.pop();
|
||||||
cu.push(arg);
|
cu.push(arg);
|
||||||
cu
|
cu
|
||||||
|
|||||||
Reference in New Issue
Block a user