Struct rustc_errors::HandlerInner[][src]

pub(crate) struct HandlerInner {
Show 13 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: 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.

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>

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>

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

future_breakage_diagnostics: Vec<Diagnostic>

Implementations

Emit all stashed diagnostics.

Emit an error; level should be Error or Fatal.

Trait Implementations

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Layout

Note: Most layout information is completely unstable and may be different between compiler versions and platforms. The only exception is types with certain repr(...) attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.

Size: 288 bytes