pub struct PendingDiagnostic {
pub code: u32,
pub args: Vec<DiagnosticArg>,
pub span: Option<SourceSpan>,
pub severity: DiagnosticSeverity,
pub related: Vec<Self>,
}Expand description
A pending diagnostic that hasn’t been rendered yet.
This stores the structured data needed to generate an error message, but defers the expensive string formatting until rendering time.
Fields§
§code: u32Diagnostic code (e.g., 2322 for type not assignable)
args: Vec<DiagnosticArg>Arguments for the message template
span: Option<SourceSpan>Primary source location
severity: DiagnosticSeveritySeverity level
Related information (additional locations)
Implementations§
Source§impl PendingDiagnostic
impl PendingDiagnostic
Sourcepub const fn error(code: u32, args: Vec<DiagnosticArg>) -> Self
pub const fn error(code: u32, args: Vec<DiagnosticArg>) -> Self
Create a new pending error diagnostic.
Sourcepub fn with_span(self, span: SourceSpan) -> Self
pub fn with_span(self, span: SourceSpan) -> Self
Attach a source span to this diagnostic.
Add related information.
Trait Implementations§
Source§impl Clone for PendingDiagnostic
impl Clone for PendingDiagnostic
Source§fn clone(&self) -> PendingDiagnostic
fn clone(&self) -> PendingDiagnostic
Returns a duplicate of the value. Read more
1.0.0 · 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 PendingDiagnostic
impl RefUnwindSafe for PendingDiagnostic
impl Send for PendingDiagnostic
impl Sync for PendingDiagnostic
impl Unpin for PendingDiagnostic
impl UnsafeUnpin for PendingDiagnostic
impl UnwindSafe for PendingDiagnostic
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