Skip to main content

Module diagnostic

Module diagnostic 

Source

Re-exportsยง

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; ๐Ÿ”’

Macrosยง

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);.

Structsยง

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.

Traitsยง

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.