rustc_errors::diagnostic

Trait Subdiagnostic

Source
pub trait Subdiagnostic
where Self: Sized,
{ // Required method fn add_to_diag_with<G: EmissionGuarantee, F: SubdiagMessageOp<G>>( self, diag: &mut Diag<'_, G>, f: &F, ); // Provided method fn add_to_diag<G: EmissionGuarantee>(self, diag: &mut Diag<'_, 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_diag_with<G: EmissionGuarantee, F: SubdiagMessageOp<G>>( self, diag: &mut Diag<'_, 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_diag<G: EmissionGuarantee>(self, diag: &mut Diag<'_, G>)

Add a subdiagnostic to an existing diagnostic.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Subdiagnostic for ElidedLifetimeInPathSubdiag

Source§

impl Subdiagnostic for ExpectedLifetimeParameter

Source§

impl Subdiagnostic for IndicateAnonymousLifetime

Source§

impl Subdiagnostic for SingleLabelManySpans

impl<'a> Subdiagnostic for OnClosureNote<'a>

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

impl<'tcx> Subdiagnostic for CaptureReasonSuggest<'tcx>

impl<'a> Subdiagnostic for RequestedLevel<'a>

impl<'tcx> Subdiagnostic for AddBound<'tcx>

impl<'tcx> Subdiagnostic for AdtDefinedHere<'tcx>

impl<'tcx> Subdiagnostic for ParentInfo<'tcx>

impl<'a> Subdiagnostic for AddAsNonDerive<'a>

impl<'tcx> Subdiagnostic for ActualImplExplNotes<'tcx>