# Trait rustc_errors::IntoDiagnostic

source ·

    pub trait IntoDiagnostic<'a, G: EmissionGuarantee = ErrorGuaranteed> {
        // Required method
        fn into_diagnostic(
            self,
            dcx: &'a DiagCtxt,
            level: Level
        ) -> DiagnosticBuilder<'a, G>;
    }

Expand description

Trait implemented by error types. This is rarely implemented manually. Instead, use `#[derive(Diagnostic)]` – see rustc_macros::Diagnostic.

## Required Methods§

source

#### fn into_diagnostic( self, dcx: &'a DiagCtxt, level: Level ) -> DiagnosticBuilder<'a, G>

Write out as a diagnostic out of `DiagCtxt`.

## Implementations on Foreign Types§

source§

### impl<'a, T, G> IntoDiagnostic<'a, G> for Spanned<T>
where T: IntoDiagnostic<'a, G>, G: EmissionGuarantee,

source§

#### fn into_diagnostic( self, dcx: &'a DiagCtxt, level: Level ) -> DiagnosticBuilder<'a, G>

source§

### impl<G: EmissionGuarantee> IntoDiagnostic<'_, G> for TargetDataLayoutErrors<'_>

source§

#### fn into_diagnostic( self, dcx: &DiagCtxt, level: Level ) -> DiagnosticBuilder<'_, G>

## Implementors§