pub struct ParserError {
pub kind: ParserErrorKind,
pub location: Fragment,
pub help: Option<Cow<'static, str>>,
}
Available on crate feature
parser
only.Expand description
An error that occurred while parsing. This error structure is pretty simple compared to what can be represented using a diagnostic. That’s fine, since most of the more complex errors arise when typechecking, rather than checking syntax.
Fields§
§kind: ParserErrorKind
What type/cause there is for this error.
location: Fragment
Where this error occurred.
help: Option<Cow<'static, str>>
Optionally, a help string that can be printed with this error.
Implementations§
Source§impl ParserError
impl ParserError
Sourcepub fn as_diagnostic(self) -> Diagnostic
pub fn as_diagnostic(self) -> Diagnostic
Turn this parser error into a full blown compiler error.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ParserError
impl RefUnwindSafe for ParserError
impl Send for ParserError
impl Sync for ParserError
impl Unpin for ParserError
impl UnwindSafe for ParserError
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more