Struct leo_errors::common::formatted::Formatted
source · 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)>
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 TypeCheckerError
impl From<Formatted> for TypeCheckerError
source§impl From<Formatted> for TypeCheckerWarning
impl From<Formatted> for TypeCheckerWarning
source§impl PartialEq for Formatted
impl PartialEq for Formatted
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)