pub enum CompilerError {
Formatted(Formatted),
Backtraced(Backtraced),
}
Expand description
CompilerError enum that represents all the errors for the leo-compiler
crate.
Variants§
Formatted(Formatted)
Backtraced(Backtraced)
Implementations§
Source§impl CompilerError
impl CompilerError
Sourcepub fn file_read_error(path: impl Debug, error: impl ErrorArg) -> Self
pub fn file_read_error(path: impl Debug, error: impl ErrorArg) -> Self
For when the compiler can’t read a file from the provided path.
Sourcepub fn illegal_static_member_assignment(
member: impl Display,
span: Span,
) -> Self
pub fn illegal_static_member_assignment( member: impl Display, span: Span, ) -> Self
For when a user tries to assign to a struct static member.
pub fn import_not_found(file_path: impl Display, span: Span) -> Self
pub fn cannot_open_cwd(err: impl ErrorArg, span: Span) -> Self
pub fn program_name_should_match_file_name( program_name: impl Display, file_name: impl Display, span: Span, ) -> Self
pub fn program_scope_name_does_not_match( program_scope_name: impl Display, file_name: impl Display, span: Span, ) -> Self
pub fn imported_program_not_found( main_program_name: impl Display, dependency_name: impl Display, span: Span, ) -> Self
pub fn const_not_evaluated(span: Span) -> Self
pub fn loop_bounds_not_evaluated(span: Span) -> Self
pub fn array_index_not_evaluated(span: Span) -> Self
pub fn const_prop_unroll_many_loops(bound: usize, span: Span) -> Self
pub fn num_exit_codes() -> i32
Trait Implementations§
Source§impl Clone for CompilerError
impl Clone for CompilerError
Source§fn clone(&self) -> CompilerError
fn clone(&self) -> CompilerError
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for CompilerError
impl Debug for CompilerError
Source§impl Display for CompilerError
impl Display for CompilerError
Source§impl Error for CompilerError
impl Error for CompilerError
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<Backtraced> for CompilerError
impl From<Backtraced> for CompilerError
Source§fn from(source: Backtraced) -> Self
fn from(source: Backtraced) -> Self
Converts to this type from the input type.
Source§impl From<CompilerError> for LeoError
impl From<CompilerError> for LeoError
Source§fn from(source: CompilerError) -> Self
fn from(source: CompilerError) -> Self
Converts to this type from the input type.
Source§impl From<Formatted> for CompilerError
impl From<Formatted> for CompilerError
Source§impl LeoMessageCode for CompilerError
impl LeoMessageCode for CompilerError
Implements the trait for LeoError Codes.
Source§fn error_code(&self) -> String
fn error_code(&self) -> String
Returns the prefixed error identifier.
Source§fn warning_code(&self) -> String
fn warning_code(&self) -> String
Returns the prefixed warning identifier.
Source§fn message_type() -> String
fn message_type() -> String
Returns the message’s code type for the program.
Source§fn code_identifier() -> i8
fn code_identifier() -> i8
The LeoErrorCode which has a default code identifier of 037
(Leo upsidedown and backwards). This is to make the exit codes
unique to Leo itself.
Auto Trait Implementations§
impl Freeze for CompilerError
impl RefUnwindSafe for CompilerError
impl Send for CompilerError
impl Sync for CompilerError
impl Unpin for CompilerError
impl UnwindSafe for CompilerError
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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