Implement a file-path remapping feature in support of debuginfo and reproducible builds.
This commit is contained in:
@@ -142,7 +142,7 @@ pub fn expand_include_str(cx: &mut ExtCtxt, sp: Span, tts: &[tokenstream::TokenT
|
||||
// Add this input file to the code map to make it available as
|
||||
// dependency information
|
||||
let filename = format!("{}", file.display());
|
||||
cx.codemap().new_filemap_and_lines(&filename, None, &src);
|
||||
cx.codemap().new_filemap_and_lines(&filename, &src);
|
||||
|
||||
base::MacEager::expr(cx.expr_str(sp, Symbol::intern(&src)))
|
||||
}
|
||||
@@ -173,7 +173,7 @@ pub fn expand_include_bytes(cx: &mut ExtCtxt, sp: Span, tts: &[tokenstream::Toke
|
||||
// Add this input file to the code map to make it available as
|
||||
// dependency information, but don't enter it's contents
|
||||
let filename = format!("{}", file.display());
|
||||
cx.codemap().new_filemap_and_lines(&filename, None, "");
|
||||
cx.codemap().new_filemap_and_lines(&filename, "");
|
||||
|
||||
base::MacEager::expr(cx.expr_lit(sp, ast::LitKind::ByteStr(Rc::new(bytes))))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user