Skip to main content Module diagnostic Copy item path Source use std::borrow::Cow ; ๐ use std::fmt ; ๐ use std::fmt::Debug ; ๐ use std::fmt::Debug ; ๐ use std::hash::Hash ; ๐ use std::hash::Hash ; ๐ use std::ops::Deref ; ๐ use std::ops::DerefMut ; ๐ use std::panic ; ๐ use std::panic ; ๐ use std::path::PathBuf ; ๐ use std::thread::panicking ; ๐ use rustc_ast::attr::version::RustcVersion ; ๐ use rustc_data_structures::stable_hash::StableHasher ; ๐ use rustc_error_messages::DiagArgMap ; ๐ use rustc_error_messages::DiagArgName ; ๐ use rustc_error_messages::IntoDiagArg ; ๐ use rustc_hashes::Hash128 ; ๐ use rustc_lint_defs::Applicability ; ๐ use rustc_macros::Decodable ; ๐ use rustc_macros::Encodable ; ๐ use rustc_serialize::Encodable ; ๐ use rustc_span::Span ; ๐ use rustc_span::Spanned ; ๐ use rustc_span::Symbol ; ๐ use tracing::debug ; ๐ use crate::dedup_hash::DedupHashEncoder ; ๐ use crate::CodeSuggestion ; ๐ use crate::DiagCtxtHandle ; ๐ use crate::DiagMessage ; ๐ use crate::ErrCode ; ๐ use crate::ErrorGuaranteed ; ๐ use crate::ExplicitBug ; ๐ use crate::Level ; ๐ use crate::MultiSpan ; ๐ use crate::StashKey ; ๐ use crate::Style ; ๐ use crate::Sublevel ; ๐ use crate::Substitution ; ๐ use crate::SubstitutionPart ; ๐ use crate::SuggestionStyle ; ๐ use crate::Suggestions ; ๐ with_fn ๐ Diag impls many &mut self -> &mut Self methods. Each one modifies an
existing diagnostic, either in a standalone fashion, e.g.
err.code(code);, or in a chained fashion to make multiple modifications,
e.g. err.code(code).span(span);.Diag Used for emitting structured error messages and other diagnostic information.
Wraps a DiagInner, adding some useful things. DiagDecorator Type used to emit diagnostic through a closure instead of implementing the Diagnostic trait. DiagInner 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. DiagLocation DiagStyledString IsLint StringPart Subdiag A โsubโ-diagnostic attached to a parent diagnostic.
For example, a note attached to an error. Diagnostic Trait implemented by error types. This is rarely implemented manually. Instead, use
#[derive(Diagnostic)] โ see rustc_macros::Diagnostic . Subdiagnostic Trait implemented by error types. This should not be implemented manually. Instead, use
#[derive(Subdiagnostic)] โ see rustc_macros::Subdiagnostic .