+//! The current rustc diagnostics emitter.
+//!
+//! An `Emitter` takes care of generating the output from a `DiagnosticBuilder` struct.
+//!
+//! There are various `Emitter` implementations that generate different output formats such as
+//! JSON and human readable output.
+//!
+//! The output types are defined in `librustc::session::config::ErrorOutputType`.
+
use Destination::*;
use syntax_pos::{SourceFile, Span, MultiSpan};
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum HumanReadableErrorType {
Default(ColorConfig),
+ AnnotateSnippet(ColorConfig),
Short(ColorConfig),
}
match self {
HumanReadableErrorType::Default(cc) => (false, cc),
HumanReadableErrorType::Short(cc) => (true, cc),
+ HumanReadableErrorType::AnnotateSnippet(cc) => (false, cc),
}
}
pub fn new_emitter(
#[derive(Debug)]
pub struct FileWithAnnotatedLines {
- file: Lrc<SourceFile>,
- lines: Vec<Line>,
+ pub file: Lrc<SourceFile>,
+ pub lines: Vec<Line>,
multiline_depth: usize,
}