Skip to main content

Diagnostic

Trait Diagnostic 

Source
pub trait Diagnostic<'a> {
    // Required method
    fn into_diag(self, dcx: DiagCtxtHandle<'a>, level: Level) -> Diag<'a>;
}
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_diag(self, dcx: DiagCtxtHandle<'a>, level: Level) -> Diag<'a>

Write out as a diagnostic out of DiagCtxt.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<'a, T> Diagnostic<'a> for Spanned<T>
where T: Diagnostic<'a>,

Source§

fn into_diag(self, dcx: DiagCtxtHandle<'a>, level: Level) -> Diag<'a>

Implementors§

Source§

impl<'a, F: FnOnce(&mut Diag<'_>)> Diagnostic<'a> for DiagDecorator<F>