fn res_rel_file(cx: &mut ExtCtxt, sp: syntax_pos::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