Module rustc_errors::diagnostic_builder
source · Macros§
- forward 🔒
DiagnosticBuilderimplsDerefMut, which allows access to the fields and methods of the embeddedDiagnostic. However, that doesn’t allow method chaining at theDiagnosticBuilderlevel. Each use of this macro defines two builder methods at that level, both of which wrap the equivalent method inDiagnostic.
Structs§
- Marker type which enables implementation of
create_bugandemit_bugfunctions for bug diagnostics. - Used for emitting structured error messages and other diagnostic information. Each constructed
DiagnosticBuildermust be consumed by a function such asemit,cancel,delay_as_bug, orinto_diagnostic. A panic occurrs if aDiagnosticBuilderis dropped without being consumed by one of these functions. - Marker type which enables implementation of
create_fatalandemit_fatalfunctions for fatal diagnostics.
Traits§
- Trait for types that
DiagnosticBuilder::emitcan return as a “guarantee” (or “proof”) token that the emission happened. - Trait implemented by error types. This is rarely implemented manually. Instead, use
#[derive(Diagnostic)]– see rustc_macros::Diagnostic.