mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-25 13:24:22 +00:00
Rollup merge of #43778 - topecongiro:handler-reset-err-count, r=arielb1
Add reset_err_count() to errors::Handler The motivation here is to allow rustfmt to recover from parse errors after failing to parse macros (cc https://github.com/rust-lang-nursery/rustfmt/issues/1742). r? @nrc
This commit is contained in:
commit
64a21f875f
@ -306,6 +306,12 @@ impl Handler {
|
||||
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, "")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user