cairo_lang_diagnostics

Trait DiagnosticEntry

source
pub trait DiagnosticEntry:
    Clone
    + Debug
    + Eq
    + Hash {
    type DbType: Upcast<dyn FilesGroup> + ?Sized;

    // Required methods
    fn format(&self, db: &Self::DbType) -> String;
    fn location(&self, db: &Self::DbType) -> DiagnosticLocation;
    fn is_same_kind(&self, other: &Self) -> bool;

    // Provided methods
    fn notes(&self, _db: &Self::DbType) -> &[DiagnosticNote] { ... }
    fn severity(&self) -> Severity { ... }
    fn error_code(&self) -> Option<ErrorCode> { ... }
}
Expand description

A trait for diagnostics (i.e., errors and warnings) across the compiler. Meant to be implemented by each module that may produce diagnostics.

Required Associated Types§

Required Methods§

source

fn format(&self, db: &Self::DbType) -> String

source

fn location(&self, db: &Self::DbType) -> DiagnosticLocation

source

fn is_same_kind(&self, other: &Self) -> bool

Returns true if the two should be regarded as the same kind when filtering duplicate diagnostics.

Provided Methods§

source

fn notes(&self, _db: &Self::DbType) -> &[DiagnosticNote]

source

fn severity(&self) -> Severity

source

fn error_code(&self) -> Option<ErrorCode>

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§