[−][src]Struct libslide::diagnostics::Diagnostic
A diagnostic for slide source code.
Fields
kind: DiagnosticKind
The diagnostic kind.
code: &'static str
The diagnostic code.
span: Span
Source location for which the diagnostic is applicable.
title: String
A summarizing title for the diagnostic.
msg: Option<String>
Diagnostic message.
associated_diagnostics: Vec<AssociatedDiagnostic>
Any additional diagnostics associated with this one. The additional diagnostics may or may not cover the same span as this one.
unspanned_associated_diagnostics: Vec<AssociatedDiagnostic>
Any additional diagnostics associated with this one, not explicitly covering any span. Implicitly, these diagnostics cover the span of the primary one.
Implementations
impl Diagnostic
[src]
pub(crate) fn span_err<S, M, C, N>(
span: S,
title: M,
code: C,
msg: N
) -> Diagnostic where
S: Into<Span>,
M: Into<String>,
C: Into<&'static str>,
N: Into<Option<String>>,
[src]
span: S,
title: M,
code: C,
msg: N
) -> Diagnostic where
S: Into<Span>,
M: Into<String>,
C: Into<&'static str>,
N: Into<Option<String>>,
Creates an error diagnostic at a span.
pub(crate) fn span_warn<S, M, C, N>(
span: S,
title: M,
code: C,
msg: N
) -> Diagnostic where
S: Into<Span>,
M: Into<String>,
C: Into<&'static str>,
N: Into<Option<String>>,
[src]
span: S,
title: M,
code: C,
msg: N
) -> Diagnostic where
S: Into<Span>,
M: Into<String>,
C: Into<&'static str>,
N: Into<Option<String>>,
Creates a warning diagnostic at a span.
pub(crate) fn with_note<M>(self, note: M) -> Diagnostic where
M: Into<String>,
[src]
M: Into<String>,
Adds a note to the diagnostic.
pub(crate) fn with_help<M>(self, note: M) -> Diagnostic where
M: Into<String>,
[src]
M: Into<String>,
Adds a help message to the diagnostic.
pub(crate) fn with_spanned_err<S, M>(self, span: S, note: M) -> Diagnostic where
S: Into<Span>,
M: Into<String>,
[src]
S: Into<Span>,
M: Into<String>,
Adds an error to the diagnostic, possibly at a different span.
pub(crate) fn with_spanned_warn<S, M>(self, span: S, note: M) -> Diagnostic where
S: Into<Span>,
M: Into<String>,
[src]
S: Into<Span>,
M: Into<String>,
Adds a warning to the diagnostic, possibly at a different span.
pub(crate) fn with_spanned_help<S, M>(self, span: S, note: M) -> Diagnostic where
S: Into<Span>,
M: Into<String>,
[src]
S: Into<Span>,
M: Into<String>,
Adds a help message to the diagnostic, possibly at a different span.
pub(crate) fn with_spanned_note<S, M>(self, span: S, note: M) -> Diagnostic where
S: Into<Span>,
M: Into<String>,
[src]
S: Into<Span>,
M: Into<String>,
Adds a note to the diagnostic, possibly at a different span.
impl Diagnostic
[src]
pub fn all_codes_with_explanations() -> HashMap<&'static str, &'static str>
[src]
All diagnostic codes and their explanations.
Auto Trait Implementations
impl RefUnwindSafe for Diagnostic
impl Send for Diagnostic
impl Sync for Diagnostic
impl Unpin for Diagnostic
impl UnwindSafe for Diagnostic
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,