DiagInner in rustc_errors - Rust (original) (raw)

pub struct DiagInner {
    pub(crate) level: Level,
    pub messages: Vec<(DiagMessage, Style)>,
    pub code: Option<ErrCode>,
    pub lint_id: Option<LintExpectationId>,
    pub span: MultiSpan,
    pub children: Vec<Subdiag>,
    pub suggestions: Suggestions,
    pub args: DiagArgMap,
    pub sort_span: Span,
    pub is_lint: Option<IsLint>,
    pub long_ty_path: Option<PathBuf>,
    pub(crate) emitted_at: DiagLocation,
}

Expand description

The main part of a diagnostic. Note that Diag, which wraps this type, is used for most operations, and should be used instead whenever possible. This type should only be used when Diag’s lifetime causes difficulties, e.g. when storing diagnostics within DiagCtxt.

This is not used for highlighting or rendering any error message. Rather, it can be used as a sort key to sort a buffer of diagnostics. By default, it is the primary span ofspan if there is one. Otherwise, it is DUMMY_SP.

With -Ztrack_diagnostics enabled, we print where in rustc this error was emitted.

§

§

§

§

§

§

§

§

Note: Most layout information is completely unstable and may even differ between compilations. 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: 296 bytes