Struct rustc_errors::HandlerInner [−][src]
pub(crate) struct HandlerInner {Show fields
flags: HandlerFlags,
err_count: usize,
warn_count: usize,
deduplicated_err_count: usize,
emitter: Box<dyn Emitter + Send>,
delayed_span_bugs: Vec<Diagnostic>,
delayed_good_path_bugs: Vec<DelayedDiagnostic>,
taught_diagnostics: FxHashSet<DiagnosticId>,
emitted_diagnostic_codes: FxHashSet<DiagnosticId>,
emitted_diagnostics: FxHashSet<u128>,
stashed_diagnostics: FxIndexMap<(Span, StashKey), Diagnostic>,
deduplicated_warn_count: usize,
future_breakage_diagnostics: Vec<Diagnostic>,
}Expand description
This inner struct exists to keep it all behind a single lock; this is done to prevent possible deadlocks in a multi-threaded compiler, as well as inconsistent state observation.
Fields
flags: HandlerFlagserr_count: usizeExpand description
The number of errors that have been emitted, including duplicates.
This is not necessarily the count that’s reported to the user once compilation ends.
warn_count: usizededuplicated_err_count: usizeemitter: Box<dyn Emitter + Send>delayed_span_bugs: Vec<Diagnostic>delayed_good_path_bugs: Vec<DelayedDiagnostic>taught_diagnostics: FxHashSet<DiagnosticId>Expand description
This set contains the DiagnosticId of all emitted diagnostics to avoid
emitting the same diagnostic with extended help (--teach) twice, which
would be unnecessary repetition.
emitted_diagnostic_codes: FxHashSet<DiagnosticId>Expand description
Used to suggest rustc –explain
emitted_diagnostics: FxHashSet<u128>Expand description
This set contains a hash of every diagnostic that has been emitted by this handler. These hashes is used to avoid emitting the same error twice.
stashed_diagnostics: FxIndexMap<(Span, StashKey), Diagnostic>Expand description
Stashed diagnostics emitted in one stage of the compiler that may be
stolen by other stages (e.g. to improve them and add more information).
The stashed diagnostics count towards the total error count.
When .abort_if_errors() is called, these are also emitted.
deduplicated_warn_count: usizeExpand description
The warning count, used for a recap upon finishing
future_breakage_diagnostics: Vec<Diagnostic>Implementations
impl HandlerInner[src]
impl HandlerInner[src]pub(crate) fn must_teach(&mut self, code: &DiagnosticId) -> bool[src]
pub(crate) fn force_print_diagnostic(&mut self, db: Diagnostic)[src]
pub(crate) fn emit_stashed_diagnostics(&mut self)[src]
pub(crate) fn emit_stashed_diagnostics(&mut self)[src]Emit all stashed diagnostics.
pub(crate) fn emit_diagnostic(&mut self, diagnostic: &Diagnostic)[src]
pub(crate) fn emit_artifact_notification(
&mut self,
path: &Path,
artifact_type: &str
)[src]
&mut self,
path: &Path,
artifact_type: &str
)
pub(crate) fn emit_unused_externs(
&mut self,
lint_level: &str,
unused_externs: &[&str]
)[src]
&mut self,
lint_level: &str,
unused_externs: &[&str]
)
pub(crate) fn treat_err_as_bug(&self) -> bool[src]
pub(crate) fn print_error_count(&mut self, registry: &Registry)[src]
pub(crate) fn err_count(&self) -> usize[src]
pub(crate) fn has_errors(&self) -> bool[src]
pub(crate) fn has_errors_or_delayed_span_bugs(&self) -> bool[src]
pub(crate) fn has_any_message(&self) -> bool[src]
pub(crate) fn abort_if_errors(&mut self)[src]
pub(crate) fn span_bug(&mut self, sp: impl Into<MultiSpan>, msg: &str) -> ![src]
pub(crate) fn emit_diag_at_span(
&mut self,
diag: Diagnostic,
sp: impl Into<MultiSpan>
)[src]
&mut self,
diag: Diagnostic,
sp: impl Into<MultiSpan>
)
pub(crate) fn delay_span_bug(&mut self, sp: impl Into<MultiSpan>, msg: &str)[src]
pub(crate) fn delay_good_path_bug(&mut self, msg: &str)[src]
pub(crate) fn failure(&mut self, msg: &str)[src]
pub(crate) fn fatal(&mut self, msg: &str) -> FatalError[src]
pub(crate) fn err(&mut self, msg: &str)[src]
pub(crate) fn emit_error(&mut self, level: Level, msg: &str)[src]
pub(crate) fn emit_error(&mut self, level: Level, msg: &str)[src]Emit an error; level should be Error or Fatal.