Module rustc_errors::diagnostic_builder
source · Macros§
- forward 🔒
DiagnosticBuilder
implsDerefMut
, which allows access to the fields and methods of the embeddedDiagnostic
. However, that doesn’t allow method chaining at theDiagnosticBuilder
level. 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_bug
andemit_bug
functions for bug diagnostics. - Used for emitting structured error messages and other diagnostic information. Each constructed
DiagnosticBuilder
must be consumed by a function such asemit
,cancel
,delay_as_bug
, orinto_diagnostic
. A panic occurrs if aDiagnosticBuilder
is dropped without being consumed by one of these functions. - Marker type which enables implementation of
create_fatal
andemit_fatal
functions for fatal diagnostics.
Traits§
- Trait for types that
DiagnosticBuilder::emit
can 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.