Module rustc_errors::diagnostic_builder
source · Macros
- forward 🔒In general, the
DiagnosticBuilderuses deref to allow access to the fields and methods of the embeddeddiagnosticin a transparent way. However, many of the methods are intended to be used in a chained way, and hence ought to returnself. In that case, we can’t just naively forward to the method on thediagnostic, because the return type would be a&Diagnosticinstead of a&DiagnosticBuilder<'a>. Thisforward!macro makes it easy to declare such methods on the builder.
Structs
- Marker type which enables implementation of
create_bugandemit_bugfunctions for bug struct diagnostics. - Used for emitting structured error messages and other diagnostic information.
- This type exists only for
DiagnosticBuilder::forget_guarantee, because it: - Marker type which enables implementation of
create_noteandemit_notefunctions for note-without-error struct diagnostics.
Enums
Traits
- Trait for types that
DiagnosticBuilder::emitcan 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.