Macros§

  • with_fn 🔒
    DiagnosticBuilder 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§

  • The main part of a diagnostic. Note that DiagnosticBuilder, which wraps this type, is used for most operations, and should be used instead whenever possible. This type should only be used when DiagnosticBuilder’s lifetime causes difficulties, e.g. when storing diagnostics within DiagCtxt.
  • A “sub”-diagnostic attached to a parent diagnostic. For example, a note attached to an error.
  • Error type for Diagnostic’s suggestions field, indicating that .disable_suggestions() was called on the Diagnostic.

Enums§

  • Simplified version of FluentValue that can implement Encodable and Decodable. Converted to a FluentValue by the emitter to be used in diagnostic translation.

Traits§

  • Trait implemented by error types. This should not be implemented manually. Instead, use #[derive(Subdiagnostic)] – see rustc_macros::Subdiagnostic.
  • Trait implemented by lint types. This should not be implemented manually. Instead, use #[derive(LintDiagnostic)] – see rustc_macros::LintDiagnostic.
  • Converts a value of a type into a DiagnosticArg (typically a field of an IntoDiagnostic struct). Implemented as a custom trait rather than From so that it is implemented on the type being converted rather than on DiagnosticArgValue, which enables types from other rustc_* crates to implement this.

Type Aliases§

  • Simplified version of FluentArg that can implement Encodable and Decodable. Collection of DiagnosticArg are converted to FluentArgs (consuming the collection) at the start of diagnostic emission.
  • Name of a diagnostic argument.

Trait Aliases§