]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_errors/lib.rs
Auto merge of #43968 - petrochenkov:span2, r=michaelwoerister
[rust.git] / src / librustc_errors / lib.rs
index 7aaf4e598d6bf273b0f06ece3b10347986a58ae9..d9b0f4ac8a6c0e4e22fd988ac3fd20adefbfb9d7 100644 (file)
@@ -302,6 +302,12 @@ pub fn set_continue_after_error(&self, continue_after_error: bool) {
         self.continue_after_error.set(continue_after_error);
     }
 
+    // NOTE: DO NOT call this function from rustc, as it relies on `err_count` being non-zero
+    // if an error happened to avoid ICEs. This function should only be called from tools.
+    pub fn reset_err_count(&self) {
+        self.err_count.set(0);
+    }
+
     pub fn struct_dummy<'a>(&'a self) -> DiagnosticBuilder<'a> {
         DiagnosticBuilder::new(self, Level::Cancelled, "")
     }