Allow supplying an error destination via the compiler driver

Allows replacing stderr with a buffer from the client.

Also, some refactoring around run_compiler.
This commit is contained in:
Nick Cameron 2016-09-27 11:45:50 +13:00
parent 322b5530ba
commit e8a4db25ac
6 changed files with 56 additions and 33 deletions

View file

@ -99,8 +99,10 @@ impl EmitterWriter {
pub fn new(dst: Box<Write + Send>,
code_map: Option<Rc<CodeMapper>>)
-> EmitterWriter {
EmitterWriter { dst: Raw(dst),
cm: code_map}
EmitterWriter {
dst: Raw(dst),
cm: code_map,
}
}
fn preprocess_annotations(&self, msp: &MultiSpan) -> Vec<FileWithAnnotatedLines> {