Implement a file-path remapping feature in support of debuginfo and reproducible builds.

This commit is contained in:
Michael Woerister 2017-04-24 19:01:19 +02:00
parent b0a4074c5e
commit 39ffea31df
34 changed files with 464 additions and 315 deletions

View file

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use codemap::CodeMap;
use codemap::{CodeMap, FilePathMapping};
use errors::Handler;
use errors::emitter::EmitterWriter;
use std::io;
@ -47,8 +47,8 @@ impl<T: Write> Write for Shared<T> {
fn test_harness(file_text: &str, span_labels: Vec<SpanLabel>, expected_output: &str) {
let output = Arc::new(Mutex::new(Vec::new()));
let code_map = Rc::new(CodeMap::new());
code_map.new_filemap_and_lines("test.rs", None, &file_text);
let code_map = Rc::new(CodeMap::new(FilePathMapping::empty()));
code_map.new_filemap_and_lines("test.rs", &file_text);
let primary_span = make_span(&file_text, &span_labels[0].start, &span_labels[0].end);
let mut msp = MultiSpan::from_span(primary_span);