pub trait StructuredDiagnostic<'tcx> {
// Required methods
fn session(&self) -> &Session;
fn code(&self) -> DiagnosticId;
fn diagnostic_common(&self) -> DiagnosticBuilder<'tcx, ErrorGuaranteed>;
// Provided methods
fn diagnostic(&self) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> { ... }
fn diagnostic_regular(
&self,
err: DiagnosticBuilder<'tcx, ErrorGuaranteed>
) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> { ... }
fn diagnostic_extended(
&self,
err: DiagnosticBuilder<'tcx, ErrorGuaranteed>
) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> { ... }
}