提交 601e3dac 编写于 作者: S Seiichi Uchida 提交者: topecongiro

Add reset_err_count() to errors::Handler

The motivation here is to allow rustfmt to recover from parse errors
after failing to parse macros.
上级 f1424995
......@@ -303,6 +303,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, "")
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册