Crate rustc_errors

source ·
Expand description

Diagnostics creation and emission for rustc.

This module contains the code for creating and emitting diagnostics.

Re-exports

  • pub use emitter::ColorConfig;
  • pub use rustc_error_messages::fluent_bundle;

Modules

Macros

Structs

Enums

  • Indicates the confidence in the correctness of a suggestion.
  • The set of available colors for the terminal foreground/background.
  • Simplified version of FluentValue that can implement Encodable and Decodable. Converted to a FluentValue by the emitter to be used in diagnostic translation.
  • Abstraction over a message in a diagnostic to support both translatable and non-translatable diagnostic messages.
  • The kind of label to attach when using SingleLabelManySpans
  • A key denoting where from a diagnostic was stashed.
  • Abstraction over a message in a subdiagnostic (i.e. label, note, help, etc) to support both translatable and non-translatable diagnostic messages.

Statics

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.
  • Trait for types that DiagnosticBuilder::emit can return as a “guarantee” (or “proof”) token that the emission happened.
  • Trait implemented by error types. This should not be implemented manually. Instead, use #[derive(Diagnostic)] – see rustc_macros::Diagnostic.
  • 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.
  • This trait describes the behavior of writers that support colored output.

Functions

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.
  • Type alias for the result of fallback_fluent_bundle - a reference-counted pointer to a lazily evaluated fluent bundle.