Enum leo_errors::errors::compiler::compiler_errors::CompilerError
source · 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 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)>
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.