[][src]Struct rustc_errors::HandlerInner

struct HandlerInner {
    flags: HandlerFlags,
    err_count: usize,
    deduplicated_err_count: usize,
    emitter: Box<dyn Emitter + Send>,
    delayed_span_bugs: Vec<Diagnostic>,
    taught_diagnostics: FxHashSet<DiagnosticId>,
    emitted_diagnostic_codes: FxHashSet<DiagnosticId>,
    emitted_diagnostics: FxHashSet<u128>,
    stashed_diagnostics: FxIndexMap<(Span, StashKey), Diagnostic>,
    deduplicated_warn_count: usize,
}

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: usize

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.

deduplicated_err_count: usizeemitter: Box<dyn Emitter + Send>delayed_span_bugs: Vec<Diagnostic>taught_diagnostics: FxHashSet<DiagnosticId>

This set contains the DiagnosticId of all emitted diagnostics to avoid emitting the same diagnostic with extended help (--teach) twice, which would be uneccessary repetition.

emitted_diagnostic_codes: FxHashSet<DiagnosticId>

Used to suggest rustc --explain

emitted_diagnostics: FxHashSet<u128>

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>

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: usize

The warning count, used for a recap upon finishing

Implementations

impl HandlerInner[src]

fn must_teach(&mut self, code: &DiagnosticId) -> bool[src]

fn force_print_diagnostic(&mut self, db: Diagnostic)[src]

fn emit_stashed_diagnostics(&mut self)[src]

Emit all stashed diagnostics.

fn emit_diagnostic(&mut self, diagnostic: &Diagnostic)[src]

fn emit_artifact_notification(&mut self, path: &Path, artifact_type: &str)[src]

fn treat_err_as_bug(&self) -> bool[src]

fn print_error_count(&mut self, registry: &Registry)[src]

fn err_count(&self) -> usize[src]

fn has_errors(&self) -> bool[src]

fn has_errors_or_delayed_span_bugs(&self) -> bool[src]

fn abort_if_errors(&mut self)[src]

fn span_bug(&mut self, sp: impl Into<MultiSpan>, msg: &str) -> ![src]

fn emit_diag_at_span(&mut self, diag: Diagnostic, sp: impl Into<MultiSpan>)[src]

fn delay_span_bug(&mut self, sp: impl Into<MultiSpan>, msg: &str)[src]

fn failure(&mut self, msg: &str)[src]

fn fatal(&mut self, msg: &str) -> FatalError[src]

fn err(&mut self, msg: &str)[src]

fn emit_error(&mut self, level: Level, msg: &str)[src]

Emit an error; level should be Error or Fatal.

fn bug(&mut self, msg: &str) -> ![src]

fn delay_as_bug(&mut self, diagnostic: Diagnostic)[src]

fn bump_err_count(&mut self)[src]

fn panic_if_treat_err_as_bug(&self)[src]

Trait Implementations

impl Drop for HandlerInner[src]

Auto Trait Implementations

impl !RefUnwindSafe for HandlerInner

impl !Send for HandlerInner

impl !Sync for HandlerInner

impl Unpin for HandlerInner

impl !UnwindSafe for HandlerInner

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.