X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibrustc_errors%2Femitter.rs;h=fca8298409a61f5add93a7a787e6c4f6ba04cda2;hb=b3169552e2bf6ba8f9d3a8898acdcbd8f6aa3ac6;hp=e1112a1557771c7e4b7f6fa4c34ba452801ec52f;hpb=73530ff80b51ed58d9b66feb48a8b22f6077e886;p=rust.git diff --git a/src/librustc_errors/emitter.rs b/src/librustc_errors/emitter.rs index e1112a15577..fca8298409a 100644 --- a/src/librustc_errors/emitter.rs +++ b/src/librustc_errors/emitter.rs @@ -1,3 +1,12 @@ +//! 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}; @@ -24,6 +33,7 @@ #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum HumanReadableErrorType { Default(ColorConfig), + AnnotateSnippet(ColorConfig), Short(ColorConfig), } @@ -33,6 +43,7 @@ pub fn unzip(self) -> (bool, ColorConfig) { match self { HumanReadableErrorType::Default(cc) => (false, cc), HumanReadableErrorType::Short(cc) => (true, cc), + HumanReadableErrorType::AnnotateSnippet(cc) => (false, cc), } } pub fn new_emitter( @@ -173,8 +184,8 @@ pub struct EmitterWriter { #[derive(Debug)] pub struct FileWithAnnotatedLines { - file: Lrc, - lines: Vec, + pub file: Lrc, + pub lines: Vec, multiline_depth: usize, }