pub struct QalaWarning {
pub category: String,
pub message: String,
pub span: Span,
pub note: Option<String>,
}Expand description
one warning produced by the type checker.
derives Debug, Clone, PartialEq. categories are the locked snake_case
identifiers also accepted by the // qala: allow(...) directive scanner:
unused_var, unreachable_code, unmatched_defer, shadowed_var,
redundant_annotation, overlapping_guards. errors are never silenced;
warnings are silenceable by the directive table built once in
[scan_allow_directives].
Fields§
§category: Stringone of the locked snake_case category strings.
message: Stringthe human-readable one-line message.
span: Spanthe source span the warning points at.
note: Option<String>optional extra information, like a shadowed_var’s prior-binding
location (“the prior binding is at line {l}:{c}”).
Trait Implementations§
Source§impl Clone for QalaWarning
impl Clone for QalaWarning
Source§fn clone(&self) -> QalaWarning
fn clone(&self) -> QalaWarning
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for QalaWarning
impl Debug for QalaWarning
Source§impl From<&QalaWarning> for Diagnostic
impl From<&QalaWarning> for Diagnostic
Source§fn from(w: &QalaWarning) -> Self
fn from(w: &QalaWarning) -> Self
build a Diagnostic from a QalaWarning reference. severity is
Warning; category is Some(w.category). warnings carry their
snake_case category as Diagnostic::category; this is what
// qala: allow(<category>) matches against and what the
playground colors yellow. the optional note field becomes the
first note line.
Source§impl PartialEq for QalaWarning
impl PartialEq for QalaWarning
Source§fn eq(&self, other: &QalaWarning) -> bool
fn eq(&self, other: &QalaWarning) -> bool
self and other values to be equal, and is used by ==.