#[non_exhaustive]pub struct Warning {
pub kind: WarningKind,
pub location: Option<SourceLocation>,
}Expand description
A non-fatal condition detected during parsing.
Use Warning::source_location to map to a location for diagnostic
rendering, and Warning::advice for help text mirroring
Error::advice.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.kind: WarningKindThe specific non-fatal condition.
location: Option<SourceLocation>Where the condition was detected, when known. Absent for warnings raised outside any source context (e.g. preprocessor configuration).
Implementations§
Source§impl Warning
impl Warning
Sourcepub fn source_location(&self) -> Option<&SourceLocation>
pub fn source_location(&self) -> Option<&SourceLocation>
Source location for this warning, when available.
Sourcepub fn advice(&self) -> Option<&'static str>
pub fn advice(&self) -> Option<&'static str>
Advice text mirroring Error::advice.
Returns None when there is no canned guidance for this kind.
Trait Implementations§
impl StructuralPartialEq for Warning
Auto Trait Implementations§
impl Freeze for Warning
impl RefUnwindSafe for Warning
impl Send for Warning
impl Sync for Warning
impl Unpin for Warning
impl UnsafeUnpin for Warning
impl UnwindSafe for Warning
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