pub enum DiagnosticAnnotation {
Related {
span: SourceSpan,
message: String,
},
Note(String),
Help(String),
Hint(String),
}Expand description
A sub-message attached to a Diagnostic.
The diagnostic’s primary span lives on Diagnostic::span; these are
only secondary spans (Related) and textual rows. There is intentionally
no Primary variant — that would be a second home for the primary span.
§Examples
use mos_core::DiagnosticAnnotation;
let help = DiagnosticAnnotation::Help("try `#set text(...)`".to_owned());
assert!(matches!(help, DiagnosticAnnotation::Help(_)));Variants§
Related
Another source location that helps explain the primary cause (e.g. the first declaration of a duplicated label).
Fields
§
span: SourceSpanWhere the related span points.
Note(String)
Attached explanation, rendered as note:.
Help(String)
Attached suggestion, rendered as help:.
Hint(String)
Attached hint, rendered as hint:.
Trait Implementations§
Source§impl Clone for DiagnosticAnnotation
impl Clone for DiagnosticAnnotation
Source§fn clone(&self) -> DiagnosticAnnotation
fn clone(&self) -> DiagnosticAnnotation
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DiagnosticAnnotation
impl RefUnwindSafe for DiagnosticAnnotation
impl Send for DiagnosticAnnotation
impl Sync for DiagnosticAnnotation
impl Unpin for DiagnosticAnnotation
impl UnsafeUnpin for DiagnosticAnnotation
impl UnwindSafe for DiagnosticAnnotation
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more