pub struct Error {
pub kind: ErrorKind,
pub err: Box<dyn AnyError>,
pub loc: Location,
pub backtrace: Backtrace,
}Expand description
Shared error envelope and result type used by fallible IR APIs. An error object that can hold any core::error::Error.
Fields§
§kind: ErrorKindThe kind of error this is
err: Box<dyn AnyError>The actual error object describing the error
loc: LocationLocation of this error in the code being compiled
backtrace: BacktraceDetails of how this error occurred
Implementations§
Trait Implementations§
Source§impl Display for Error
This does not print Location or Backtrace. Use Printable::disp for that.
impl Display for Error
This does not print Location or Backtrace. Use Printable::disp for that.
Source§impl Error for Error
impl Error for Error
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<Diagnostic> for Error
impl From<Diagnostic> for Error
Source§fn from(diagnostic: Diagnostic) -> Error
fn from(diagnostic: Diagnostic) -> Error
Converts to this type from the input type.
Source§impl From<Diagnostic> for Error
impl From<Diagnostic> for Error
Source§fn from(error: Diagnostic) -> Error
fn from(error: Diagnostic) -> Error
Converts to this type from the input type.
Source§impl From<Diagnostic> for Error
impl From<Diagnostic> for Error
Source§fn from(diagnostic: Diagnostic) -> Self
fn from(diagnostic: Diagnostic) -> Self
Converts to this type from the input type.
Source§impl From<EnumParseError> for Error
impl From<EnumParseError> for Error
Source§fn from(error: EnumParseError) -> Error
fn from(error: EnumParseError) -> Error
Converts to this type from the input type.
Source§impl From<EnumValueError> for Error
impl From<EnumValueError> for Error
Source§fn from(error: EnumValueError) -> Error
fn from(error: EnumValueError) -> Error
Converts to this type from the input type.
Source§impl From<IntegerParseError> for Error
impl From<IntegerParseError> for Error
Source§fn from(error: IntegerParseError) -> Error
fn from(error: IntegerParseError) -> Error
Converts to this type from the input type.
Source§impl From<SerdeError> for Error
impl From<SerdeError> for Error
Source§fn from(value: SerdeError) -> Error
fn from(value: SerdeError) -> Error
Converts to this type from the input type.
Auto Trait Implementations§
impl !Freeze for Error
impl !RefUnwindSafe for Error
impl !UnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
Blanket Implementations§
impl<T> AnyError for T
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.