[][src]Module ra_ap_hir_expand::diagnostics

Semantic errors and warnings.

The Diagnostic trait defines a trait object which can represent any diagnostic.

DiagnosticSink struct is used as an emitter for diagnostic. When creating a DiagnosticSink, you supply a callback which can react to a dyn Diagnostic or to any concrete diagnostic (downcasting is sued internally).

Because diagnostics store file offsets, it's a bad idea to store them directly in salsa. For this reason, every hir subsytem defines it's own strongly-typed closed set of diagnostics which use hir ids internally, are stored in salsa and do not implement the Diagnostic trait. Instead, a subsystem provides a separate, non-query-based API which can walk all stored values and transform them into instances of Diagnostic.

Structs

DiagnosticCode
DiagnosticSink
DiagnosticSinkBuilder

Traits

Diagnostic