pub trait AddToDiagnosticwhere
    Self: Sized,{
    // Required method
    fn add_to_diagnostic_with<F>(self, diag: &mut Diagnostic, f: F)
       where F: Fn(&mut Diagnostic, SubdiagnosticMessage) -> SubdiagnosticMessage;

    // Provided method
    fn add_to_diagnostic(self, diag: &mut Diagnostic) { ... }
}
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<F>(self, diag: &mut Diagnostic, f: F)where F: Fn(&mut Diagnostic, SubdiagnosticMessage) -> SubdiagnosticMessage,

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(self, diag: &mut Diagnostic)

Add a subdiagnostic to an existing diagnostic.

Implementors§

source§

impl AddToDiagnostic for DelayedAtWithNewline

source§

impl AddToDiagnostic for DelayedAtWithoutNewline

source§

impl AddToDiagnostic for ExpectedLifetimeParameter

source§

impl AddToDiagnostic for IndicateAnonymousLifetime

source§

impl AddToDiagnostic for InvalidFlushedDelayedDiagnosticLevel

source§

impl AddToDiagnostic for SingleLabelManySpans

impl<'a, 'tcx> AddToDiagnostic for TypeNoCopy<'a, 'tcx>

impl<'tcx> AddToDiagnostic for AddBound<'tcx>

impl<'tcx> AddToDiagnostic for Overlap<'tcx>

impl<'tcx> AddToDiagnostic for Uncovered<'tcx>

impl<'tcx> AddToDiagnostic for AdtDefinedHere<'tcx>

impl<'tcx> AddToDiagnostic for ParentInfo<'tcx>