use emitter::{Emitter, EmitterWriter, is_case_difference};
use registry::Registry;
-
use rustc_data_structures::sync::{self, Lrc, Lock};
use rustc_data_structures::fx::{FxHashSet, FxIndexMap};
use rustc_data_structures::stable_hasher::StableHasher;
SpanSnippetError,
};
+pub type PResult<'a, T> = Result<T, DiagnosticBuilder<'a>>;
+
+// `PResult` is used a lot. Make sure it doesn't unintentionally get bigger.
+// (See also the comment on `DiagnosticBuilderInner`.)
+#[cfg(target_arch = "x86_64")]
+rustc_data_structures::static_assert_size!(PResult<'_, bool>, 16);
+
/// Indicates the confidence in the correctness of a suggestion.
///
/// All suggestions are marked with an `Applicability`. Tools use the applicability of a suggestion
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)
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();
}
#[macro_export]
-macro_rules! pluralise {
+macro_rules! pluralize {
($x:expr) => {
if $x != 1 { "s" } else { "" }
};