]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_errors/lib.rs
Rollup merge of #61503 - jethrogb:jb/fix-sgx-test, r=alexcrichton
[rust.git] / src / librustc_errors / lib.rs
index e173e1060cc1097988a89a93ed98593078c565fd..7bc7d0ddaf243090a3f768a2ee6ea6888e2a8135 100644 (file)
 use std::cell::Cell;
 use std::{error, fmt};
 use std::panic;
+use std::path::Path;
 
 use termcolor::{ColorSpec, Color};
 
 mod diagnostic;
 mod diagnostic_builder;
 pub mod emitter;
+pub mod annotate_rs_emitter;
 mod snippet;
 pub mod registry;
 mod styled_buffer;
@@ -294,16 +296,9 @@ fn description(&self) -> &str {
 pub use diagnostic::{Diagnostic, SubDiagnostic, DiagnosticStyledString, DiagnosticId};
 pub use diagnostic_builder::DiagnosticBuilder;
 
-/// A handler deals with two kinds of compiler output.
-/// - Errors: certain errors (fatal, bug, unimpl) may cause immediate exit,
-///   others log errors for later reporting.
-/// - Directives: with --error-format=json, the compiler produces directives
-///   that indicate when certain actions have completed, which are useful for
-///   Cargo. They may change at any time and should not be considered a public
-///   API.
-///
-/// This crate's name (rustc_errors) doesn't encompass the directives, because
-/// directives were added much later.
+/// A handler deals with errors and other compiler output.
+/// Certain errors (fatal, bug, unimpl) may cause immediate exit,
+/// others log errors for later reporting.
 pub struct Handler {
     pub flags: HandlerFlags,
 
@@ -775,8 +770,8 @@ fn emit_db(&self, db: &DiagnosticBuilder<'_>) {
         }
     }
 
-    pub fn maybe_emit_json_directive(&self, directive: String) {
-        self.emitter.borrow_mut().maybe_emit_json_directive(directive);
+    pub fn emit_artifact_notification(&self, path: &Path, artifact_type: &str) {
+        self.emitter.borrow_mut().emit_artifact_notification(path, artifact_type);
     }
 }