Revert a change to the relative path for macro-expanded include!s

This commit is contained in:
Jeffrey Seyfried 2016-06-24 11:43:59 +00:00
parent ad7fe6521b
commit fd12c34601

View File

@ -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