Module rustc_errors::diagnostic
source · Macros§
- with_fn 🔒
Diagimpls many&mut self -> &mut Selfmethods. 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§
- Marker type which enables implementation of
create_bugandemit_bugfunctions for bug diagnostics. - Used for emitting structured error messages and other diagnostic information. Wraps a
DiagInner, adding some useful things. - 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 whenDiag’s lifetime causes difficulties, e.g. when storing diagnostics withinDiagCtxt. - Marker type which enables implementation of
create_fatalandemit_fatalfunctions for fatal diagnostics. - A “sub”-diagnostic attached to a parent diagnostic. For example, a note attached to an error.
- Error type for
DiagInner’ssuggestionsfield, indicating that.disable_suggestions()was called on theDiagInner.
Enums§
- Simplified version of
FluentValuethat can implementEncodableandDecodable. Converted to aFluentValueby the emitter to be used in diagnostic translation.
Traits§
- Trait implemented by error types. This is rarely implemented manually. Instead, use
#[derive(Diagnostic)]– see rustc_macros::Diagnostic. - Trait for types that
Diag::emitcan return as a “guarantee” (or “proof”) token that the emission happened. - Converts a value of a type into a
DiagArg(typically a field of anDiagstruct). Implemented as a custom trait rather thanFromso that it is implemented on the type being converted rather than onDiagArgValue, which enables types from otherrustc_*crates to implement this. - Trait implemented by lint types. This should not be implemented manually. Instead, use
#[derive(LintDiagnostic)]– see rustc_macros::LintDiagnostic. - Trait implemented by error types. This should not be implemented manually. Instead, use
#[derive(Subdiagnostic)]– see rustc_macros::Subdiagnostic.
Type Aliases§
- Simplified version of
FluentArgthat can implementEncodableandDecodable. Collection ofDiagArgare converted toFluentArgs(consuming the collection) at the start of diagnostic emission. - Name of a diagnostic argument.