]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_errors/emitter.rs
Rollup merge of #61686 - phansch:librustc_errors_docs, r=estebank
[rust.git] / src / librustc_errors / emitter.rs
index fcc0358ea7c11332065e126080f88ffba7da1eb7..fca8298409a61f5add93a7a787e6c4f6ba04cda2 100644 (file)
@@ -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,7 +33,7 @@
 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
 pub enum HumanReadableErrorType {
     Default(ColorConfig),
-    AnnotateRs(ColorConfig),
+    AnnotateSnippet(ColorConfig),
     Short(ColorConfig),
 }
 
@@ -34,7 +43,7 @@ pub fn unzip(self) -> (bool, ColorConfig) {
         match self {
             HumanReadableErrorType::Default(cc) => (false, cc),
             HumanReadableErrorType::Short(cc) => (true, cc),
-            HumanReadableErrorType::AnnotateRs(cc) => (false, cc),
+            HumanReadableErrorType::AnnotateSnippet(cc) => (false, cc),
         }
     }
     pub fn new_emitter(