Implement a file-path remapping feature in support of debuginfo and reproducible builds.
This commit is contained in:
parent
b0a4074c5e
commit
39ffea31df
34 changed files with 464 additions and 315 deletions
|
@ -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))))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue