pub enum AstError {
ReaderReadError {
err: Error,
},
ParseError {
err: Error,
},
WriteError {
err: Error,
},
SanityError(SanityError),
ResolveError(ResolveError),
TypeError(TypeError),
NullError(NullError),
LocationError(LocationError),
PruneError(PruneError),
FlattenError(FlattenError),
}
Expand description
Defines toplevel errors that occur in this crate.
Variants§
ReaderReadError
We could not read from the given parser.
ParseError
The parser failed.
WriteError
Failed to write to the given writer.
SanityError(SanityError)
An error has occurred while resolving enum variants.
ResolveError(ResolveError)
An error has occurred while resolving variable scopes.
TypeError(TypeError)
An error has occurred during type checking.
NullError(NullError)
An error has occurred during null-analysis.
LocationError(LocationError)
An error has occurred during location analysis.
PruneError(PruneError)
An error has occurred while pruning the tree for compilation.
FlattenError(FlattenError)
An error has occurred while flattening the AST’s symbol tables.
Implementations§
source§impl AstError
impl AstError
sourcepub fn prettyprint(&self, file: impl AsRef<str>, source: impl AsRef<str>)
pub fn prettyprint(&self, file: impl AsRef<str>, source: impl AsRef<str>)
Prints the warning in a pretty way to stderr.
§Arguments
file
: The ‘path’ of the file (or some other identifier) where the source text originates from.source
: The source text to read the debug range from.
sourcepub fn prettywrite(
&self,
writer: impl Write,
file: impl AsRef<str>,
source: impl AsRef<str>,
) -> Result<(), Error>
pub fn prettywrite( &self, writer: impl Write, file: impl AsRef<str>, source: impl AsRef<str>, ) -> Result<(), Error>
Prints the warning in a pretty way to the given Write
r.
§Arguments:
writer
: TheWrite
-enabled object to write to.file
: The ‘path’ of the file (or some other identifier) where the source text originates from.source
: The source text to read the debug range from.
§Errors
This function may error if we failed to write to the given writer.
Trait Implementations§
source§impl Error for AstError
impl Error for AstError
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()
source§impl From<FlattenError> for AstError
impl From<FlattenError> for AstError
source§fn from(err: FlattenError) -> Self
fn from(err: FlattenError) -> Self
Converts to this type from the input type.
source§impl From<LocationError> for AstError
impl From<LocationError> for AstError
source§fn from(err: LocationError) -> Self
fn from(err: LocationError) -> Self
Converts to this type from the input type.
source§impl From<PruneError> for AstError
impl From<PruneError> for AstError
source§fn from(err: PruneError) -> Self
fn from(err: PruneError) -> Self
Converts to this type from the input type.
source§impl From<ResolveError> for AstError
impl From<ResolveError> for AstError
source§fn from(err: ResolveError) -> Self
fn from(err: ResolveError) -> Self
Converts to this type from the input type.
source§impl From<SanityError> for AstError
impl From<SanityError> for AstError
source§fn from(err: SanityError) -> Self
fn from(err: SanityError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for AstError
impl !RefUnwindSafe for AstError
impl !Send for AstError
impl !Sync for AstError
impl Unpin for AstError
impl !UnwindSafe for AstError
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> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request