Merge pull request #1663 from topecongiro/issue-1660

Use with_emitter instead of with_tty_emitter
This commit is contained in:
Nick Cameron 2017-06-13 14:28:19 +12:00 committed by GitHub
commit 6c9e77cdb3

View file

@ -460,8 +460,9 @@ fn format_ast<F>(krate: &ast::Crate,
}
// Reset the error count.
if parse_session.span_diagnostic.has_errors() {
parse_session.span_diagnostic =
Handler::with_tty_emitter(ColorConfig::Auto, true, false, Some(codemap.clone()));
let silent_emitter = Box::new(EmitterWriter::new(Box::new(Vec::new()),
Some(codemap.clone())));
parse_session.span_diagnostic = Handler::with_emitter(true, false, silent_emitter);
}
}