diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs index a4465b98104..70c435a1bcc 100644 --- a/compiler/rustc_errors/src/lib.rs +++ b/compiler/rustc_errors/src/lib.rs @@ -431,7 +431,7 @@ struct HandlerInner { warn_count: usize, deduplicated_err_count: usize, emitter: Box, - delayed_span_bugs: Vec, + span_delayed_bugs: Vec, delayed_good_path_bugs: Vec, /// This flag indicates that an expected diagnostic was emitted and suppressed. /// This is used for the `delayed_good_path_bugs` check. @@ -545,12 +545,12 @@ impl Drop for HandlerInner { self.emit_stashed_diagnostics(); if !self.has_errors() { - let bugs = std::mem::replace(&mut self.delayed_span_bugs, Vec::new()); + let bugs = std::mem::replace(&mut self.span_delayed_bugs, Vec::new()); self.flush_delayed(bugs, "no errors encountered even though `span_delayed_bug` issued"); } // FIXME(eddyb) this explains what `delayed_good_path_bugs` are! - // They're `delayed_span_bugs` but for "require some diagnostic happened" + // They're `span_delayed_bugs` but for "require some diagnostic happened" // instead of "require some error happened". Sadly that isn't ideal, as // lints can be `#[allow]`'d, potentially leading to this triggering. // Also, "good path" should be replaced with a better naming. @@ -609,7 +609,7 @@ impl Handler { deduplicated_err_count: 0, deduplicated_warn_count: 0, emitter, - delayed_span_bugs: Vec::new(), + span_delayed_bugs: Vec::new(), delayed_good_path_bugs: Vec::new(), suppressed_expected_diag: false, taught_diagnostics: Default::default(), @@ -664,7 +664,7 @@ impl Handler { inner.deduplicated_warn_count = 0; // actually free the underlying memory (which `clear` would not do) - inner.delayed_span_bugs = Default::default(); + inner.span_delayed_bugs = Default::default(); inner.delayed_good_path_bugs = Default::default(); inner.taught_diagnostics = Default::default(); inner.emitted_diagnostic_codes = Default::default(); @@ -1078,8 +1078,8 @@ impl Handler { ErrorGuaranteed::unchecked_claim_error_was_emitted() }) } - pub fn has_errors_or_delayed_span_bugs(&self) -> Option { - self.inner.borrow().has_errors_or_delayed_span_bugs().then(|| { + pub fn has_errors_or_span_delayed_bugs(&self) -> Option { + self.inner.borrow().has_errors_or_span_delayed_bugs().then(|| { #[allow(deprecated)] ErrorGuaranteed::unchecked_claim_error_was_emitted() }) @@ -1267,7 +1267,7 @@ impl Handler { pub fn flush_delayed(&self) { let mut inner = self.inner.lock(); - let bugs = std::mem::replace(&mut inner.delayed_span_bugs, Vec::new()); + let bugs = std::mem::replace(&mut inner.span_delayed_bugs, Vec::new()); inner.flush_delayed(bugs, "no errors encountered even though `span_delayed_bug` issued"); } } @@ -1325,11 +1325,11 @@ impl HandlerInner { if diagnostic.level == Level::DelayedBug { // FIXME(eddyb) this should check for `has_errors` and stop pushing - // once *any* errors were emitted (and truncate `delayed_span_bugs` + // once *any* errors were emitted (and truncate `span_delayed_bugs` // when an error is first emitted, also), but maybe there's a case // in which that's not sound? otherwise this is really inefficient. let backtrace = std::backtrace::Backtrace::capture(); - self.delayed_span_bugs + self.span_delayed_bugs .push(DelayedDiagnostic::with_backtrace(diagnostic.clone(), backtrace)); if !self.flags.report_delayed_bugs { @@ -1444,7 +1444,7 @@ impl HandlerInner { } fn delayed_bug_count(&self) -> usize { - self.delayed_span_bugs.len() + self.delayed_good_path_bugs.len() + self.span_delayed_bugs.len() + self.delayed_good_path_bugs.len() } fn print_error_count(&mut self, registry: &Registry) { @@ -1565,15 +1565,15 @@ impl HandlerInner { fn has_errors_or_lint_errors(&self) -> bool { self.has_errors() || self.lint_err_count > 0 } - fn has_errors_or_delayed_span_bugs(&self) -> bool { - self.has_errors() || !self.delayed_span_bugs.is_empty() + fn has_errors_or_span_delayed_bugs(&self) -> bool { + self.has_errors() || !self.span_delayed_bugs.is_empty() } fn has_any_message(&self) -> bool { self.err_count() > 0 || self.lint_err_count > 0 || self.warn_count > 0 } fn is_compilation_going_to_fail(&self) -> bool { - self.has_errors() || self.lint_err_count > 0 || !self.delayed_span_bugs.is_empty() + self.has_errors() || self.lint_err_count > 0 || !self.span_delayed_bugs.is_empty() } fn abort_if_errors(&mut self) { diff --git a/compiler/rustc_incremental/src/persist/fs.rs b/compiler/rustc_incremental/src/persist/fs.rs index dc6b2be81eb..92297a27a63 100644 --- a/compiler/rustc_incremental/src/persist/fs.rs +++ b/compiler/rustc_incremental/src/persist/fs.rs @@ -312,7 +312,7 @@ pub fn finalize_session_directory(sess: &Session, svh: Option) { let incr_comp_session_dir: PathBuf = sess.incr_comp_session_dir().clone(); - if let Some(_) = sess.has_errors_or_delayed_span_bugs() { + if let Some(_) = sess.has_errors_or_span_delayed_bugs() { // If there have been any errors during compilation, we don't want to // publish this session directory. Rather, we'll just delete it. diff --git a/compiler/rustc_incremental/src/persist/save.rs b/compiler/rustc_incremental/src/persist/save.rs index d6320d680e7..ff0953e9f7b 100644 --- a/compiler/rustc_incremental/src/persist/save.rs +++ b/compiler/rustc_incremental/src/persist/save.rs @@ -32,7 +32,7 @@ pub fn save_dep_graph(tcx: TyCtxt<'_>) { return; } // This is going to be deleted in finalize_session_directory, so let's not create it - if let Some(_) = sess.has_errors_or_delayed_span_bugs() { + if let Some(_) = sess.has_errors_or_span_delayed_bugs() { return; } @@ -87,7 +87,7 @@ pub fn save_work_product_index( return; } // This is going to be deleted in finalize_session_directory, so let's not create it - if let Some(_) = sess.has_errors_or_delayed_span_bugs() { + if let Some(_) = sess.has_errors_or_span_delayed_bugs() { return; } diff --git a/compiler/rustc_infer/src/infer/error_reporting/mod.rs b/compiler/rustc_infer/src/infer/error_reporting/mod.rs index fee25ca33ff..a36b93f4a44 100644 --- a/compiler/rustc_infer/src/infer/error_reporting/mod.rs +++ b/compiler/rustc_infer/src/infer/error_reporting/mod.rs @@ -131,7 +131,7 @@ pub struct TypeErrCtxt<'a, 'tcx> { impl Drop for TypeErrCtxt<'_, '_> { fn drop(&mut self) { - if let Some(_) = self.infcx.tcx.sess.has_errors_or_delayed_span_bugs() { + if let Some(_) = self.infcx.tcx.sess.has_errors_or_span_delayed_bugs() { // ok, emitted an error. } else { self.infcx diff --git a/compiler/rustc_query_system/src/dep_graph/graph.rs b/compiler/rustc_query_system/src/dep_graph/graph.rs index 5acd012ef04..bc09972185a 100644 --- a/compiler/rustc_query_system/src/dep_graph/graph.rs +++ b/compiler/rustc_query_system/src/dep_graph/graph.rs @@ -818,7 +818,7 @@ impl DepGraphData { None => {} } - if let None = qcx.dep_context().sess().has_errors_or_delayed_span_bugs() { + if let None = qcx.dep_context().sess().has_errors_or_span_delayed_bugs() { panic!("try_mark_previous_green() - Forcing the DepNode should have set its color") } diff --git a/compiler/rustc_session/src/session.rs b/compiler/rustc_session/src/session.rs index 88df11a21b6..da044a98fed 100644 --- a/compiler/rustc_session/src/session.rs +++ b/compiler/rustc_session/src/session.rs @@ -551,8 +551,8 @@ impl Session { pub fn has_errors(&self) -> Option { self.diagnostic().has_errors() } - pub fn has_errors_or_delayed_span_bugs(&self) -> Option { - self.diagnostic().has_errors_or_delayed_span_bugs() + pub fn has_errors_or_span_delayed_bugs(&self) -> Option { + self.diagnostic().has_errors_or_span_delayed_bugs() } pub fn is_compilation_going_to_fail(&self) -> Option { self.diagnostic().is_compilation_going_to_fail()