pub struct Error<'source> {
pub source: &'source str,
pub span: Span,
pub kind: ErrorKind,
}
Expand description
A compilation error.
Contains a span and a reference to the source code to allow better error formatting.
Fields§
§source: &'source str
A reference to the source code.
span: Span
The byte range of the source code this error is referencing.
kind: ErrorKind
The type of error.
Implementations§
Trait Implementations§
Source§impl Error for Error<'_>
impl Error for Error<'_>
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Auto Trait Implementations§
impl<'source> Freeze for Error<'source>
impl<'source> RefUnwindSafe for Error<'source>
impl<'source> Send for Error<'source>
impl<'source> Sync for Error<'source>
impl<'source> Unpin for Error<'source>
impl<'source> UnwindSafe for Error<'source>
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