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