From 5930551f6a471164d61d0b67cd412b32461924e3 Mon Sep 17 00:00:00 2001 From: Quentin Boyer Date: Wed, 16 Oct 2019 13:13:13 +0200 Subject: Check if there are any delayed_span_bugs and abort incremental compilation in this case --- src/librustc_errors/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/librustc_errors') diff --git a/src/librustc_errors/lib.rs b/src/librustc_errors/lib.rs index 63df052a225..9743cf0d805 100644 --- a/src/librustc_errors/lib.rs +++ b/src/librustc_errors/lib.rs @@ -704,6 +704,9 @@ impl Handler { pub fn has_errors(&self) -> bool { self.inner.borrow().has_errors() } + pub fn has_errors_or_delayed_span_bugs(&self) -> bool { + self.inner.borrow().has_errors_or_delayed_span_bugs() + } pub fn print_error_count(&self, registry: &Registry) { self.inner.borrow_mut().print_error_count(registry) @@ -862,6 +865,9 @@ impl HandlerInner { fn has_errors(&self) -> bool { self.err_count() > 0 } + fn has_errors_or_delayed_span_bugs(&self) -> bool { + self.has_errors() || !self.delayed_span_bugs.is_empty() + } fn abort_if_errors_and_should_abort(&mut self) { self.emit_stashed_diagnostics(); -- cgit 1.4.1-3-g733a5