Remove BasicEmitter

This commit is contained in:
Jonathan Turner 2016-07-05 15:24:23 -04:00
parent 3c85f414e9
commit 8f044fae36
9 changed files with 99 additions and 87 deletions

View file

@ -22,7 +22,8 @@ use mir::transform as mir_pass;
use syntax::ast::{NodeId, Name};
use errors::{self, DiagnosticBuilder};
use errors::emitter::{Emitter, BasicEmitter, EmitterWriter};
use errors::emitter::{Emitter, EmitterWriter};
use errors::snippet::FormatMode;
use syntax::json::JsonEmitter;
use syntax::feature_gate;
use syntax::parse;
@ -439,7 +440,7 @@ pub fn build_session_with_codemap(sopts: config::Options,
config::ErrorOutputType::HumanReadable(color_config) => {
Box::new(EmitterWriter::stderr(color_config,
Some(registry),
codemap.clone(),
Some(codemap.clone()),
errors::snippet::FormatMode::EnvironmentSelected))
}
config::ErrorOutputType::Json => {
@ -577,7 +578,10 @@ unsafe fn configure_llvm(sess: &Session) {
pub fn early_error(output: config::ErrorOutputType, msg: &str) -> ! {
let mut emitter: Box<Emitter> = match output {
config::ErrorOutputType::HumanReadable(color_config) => {
Box::new(BasicEmitter::stderr(color_config))
Box::new(EmitterWriter::stderr(color_config,
None,
None,
FormatMode::EnvironmentSelected))
}
config::ErrorOutputType::Json => Box::new(JsonEmitter::basic()),
};
@ -588,7 +592,10 @@ pub fn early_error(output: config::ErrorOutputType, msg: &str) -> ! {
pub fn early_warn(output: config::ErrorOutputType, msg: &str) {
let mut emitter: Box<Emitter> = match output {
config::ErrorOutputType::HumanReadable(color_config) => {
Box::new(BasicEmitter::stderr(color_config))
Box::new(EmitterWriter::stderr(color_config,
None,
None,
FormatMode::EnvironmentSelected))
}
config::ErrorOutputType::Json => Box::new(JsonEmitter::basic()),
};