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