pub struct Formatted {
pub span: Span,
pub backtrace: Backtraced,
}
Expand description
Formatted compiler error type
undefined value x
–> file.leo: 2:8
|
2 | let a = x;
| ^
|
= help: Initialize a variable x
first.
Makes use of the same fields as a BacktracedError.
Fields§
§span: Span
The formatted error span information.
backtrace: Backtraced
The backtrace to track where the Leo error originated.
Implementations§
Source§impl Formatted
impl Formatted
Sourcepub fn new_from_span<S>(
message: S,
help: Option<String>,
code: i32,
code_identifier: i8,
type_: String,
error: bool,
span: Span,
backtrace: Backtrace,
) -> Selfwhere
S: ToString,
pub fn new_from_span<S>(
message: S,
help: Option<String>,
code: i32,
code_identifier: i8,
type_: String,
error: bool,
span: Span,
backtrace: Backtrace,
) -> Selfwhere
S: ToString,
Creates a backtraced error from a span and a backtrace.
Sourcepub fn error_code(&self) -> String
pub fn error_code(&self) -> String
Returns an error identifier.
Sourcepub fn warning_code(&self) -> String
pub fn warning_code(&self) -> String
Returns an warning identifier.
Trait Implementations§
Source§impl Error for Formatted
impl Error for Formatted
Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
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
Source§impl From<Formatted> for CompilerError
impl From<Formatted> for CompilerError
Source§impl From<Formatted> for FlattenError
impl From<Formatted> for FlattenError
Source§impl From<Formatted> for LoopUnrollerError
impl From<Formatted> for LoopUnrollerError
Source§impl From<Formatted> for PackageError
impl From<Formatted> for PackageError
Source§impl From<Formatted> for ParserError
impl From<Formatted> for ParserError
Source§impl From<Formatted> for ParserWarning
impl From<Formatted> for ParserWarning
Source§impl From<Formatted> for StaticAnalyzerError
impl From<Formatted> for StaticAnalyzerError
Source§impl From<Formatted> for StaticAnalyzerWarning
impl From<Formatted> for StaticAnalyzerWarning
Source§impl From<Formatted> for TypeCheckerError
impl From<Formatted> for TypeCheckerError
Source§impl From<Formatted> for TypeCheckerWarning
impl From<Formatted> for TypeCheckerWarning
impl StructuralPartialEq for Formatted
Auto Trait Implementations§
impl Freeze for Formatted
impl RefUnwindSafe for Formatted
impl Send for Formatted
impl Sync for Formatted
impl Unpin for Formatted
impl UnwindSafe for Formatted
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