pub trait AddToDiagnostic
where Self: Sized,
{ // Required method fn add_to_diagnostic_with<G: EmissionGuarantee, F: SubdiagnosticMessageOp<G>>( self, diag: &mut DiagnosticBuilder<'_, G>, f: F ); // Provided method fn add_to_diagnostic<G: EmissionGuarantee>( self, diag: &mut DiagnosticBuilder<'_, G> ) { ... } }
Expand description

Trait implemented by error types. This should not be implemented manually. Instead, use #[derive(Subdiagnostic)] – see rustc_macros::Subdiagnostic.

Required Methods§

source

fn add_to_diagnostic_with<G: EmissionGuarantee, F: SubdiagnosticMessageOp<G>>( self, diag: &mut DiagnosticBuilder<'_, G>, f: F )

Add a subdiagnostic to an existing diagnostic where f is invoked on every message used (to optionally perform eager translation).

Provided Methods§

source

fn add_to_diagnostic<G: EmissionGuarantee>( self, diag: &mut DiagnosticBuilder<'_, G> )

Add a subdiagnostic to an existing diagnostic.

Object Safety§

This trait is not object safe.

Implementors§