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

The warning count, used for a recap upon finishing

future_breakage_diagnostics: Vec<Diagnostic>

Implementations

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]

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]

pub(crate) fn emit_unused_externs(
    &mut self,
    lint_level: &str,
    unused_externs: &[&str]
)
[src]

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]

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]

Emit an error; level should be Error or Fatal.

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

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

pub(crate) fn flush_delayed(&mut self, bugs: Vec<Diagnostic>, explanation: &str)[src]

pub(crate) fn bump_err_count(&mut self)[src]

pub(crate) fn bump_warn_count(&mut self)[src]

pub(crate) fn panic_if_treat_err_as_bug(&self)[src]

Trait Implementations

impl Drop for HandlerInner[src]

fn drop(&mut self)[src]

Executes the destructor for this type. Read more

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]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.