Add comment why thiserror is not used
This commit is contained in:
@@ -103,6 +103,8 @@ pub enum DataValueCastFailure {
|
||||
FromInteger(i64, Type),
|
||||
}
|
||||
|
||||
// This is manually implementing Error and Display instead of using thiserror to reduce the amount
|
||||
// of dependencies used by Cranelift.
|
||||
impl std::error::Error for DataValueCastFailure {}
|
||||
|
||||
impl Display for DataValueCastFailure {
|
||||
|
||||
@@ -186,6 +186,8 @@ pub enum LookupError {
|
||||
Unsupported,
|
||||
}
|
||||
|
||||
// This is manually implementing Error and Display instead of using thiserror to reduce the amount
|
||||
// of dependencies used by Cranelift.
|
||||
impl std::error::Error for LookupError {}
|
||||
|
||||
impl fmt::Display for LookupError {
|
||||
|
||||
@@ -21,6 +21,8 @@ pub enum RegisterMappingError {
|
||||
UnsupportedRegisterBank(&'static str),
|
||||
}
|
||||
|
||||
// This is manually implementing Error and Display instead of using thiserror to reduce the amount
|
||||
// of dependencies used by Cranelift.
|
||||
impl std::error::Error for RegisterMappingError {}
|
||||
|
||||
impl std::fmt::Display for RegisterMappingError {
|
||||
|
||||
@@ -41,6 +41,8 @@ pub enum CodegenError {
|
||||
/// A convenient alias for a `Result` that uses `CodegenError` as the error type.
|
||||
pub type CodegenResult<T> = Result<T, CodegenError>;
|
||||
|
||||
// This is manually implementing Error and Display instead of using thiserror to reduce the amount
|
||||
// of dependencies used by Cranelift.
|
||||
impl std::error::Error for CodegenError {
|
||||
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
|
||||
match self {
|
||||
|
||||
@@ -102,6 +102,8 @@ pub struct VerifierError {
|
||||
pub message: String,
|
||||
}
|
||||
|
||||
// This is manually implementing Error and Display instead of using thiserror to reduce the amount
|
||||
// of dependencies used by Cranelift.
|
||||
impl std::error::Error for VerifierError {}
|
||||
|
||||
impl Display for VerifierError {
|
||||
@@ -179,6 +181,8 @@ pub type VerifierResult<T> = Result<T, VerifierErrors>;
|
||||
#[derive(Debug, Default, PartialEq, Eq, Clone)]
|
||||
pub struct VerifierErrors(pub Vec<VerifierError>);
|
||||
|
||||
// This is manually implementing Error and Display instead of using thiserror to reduce the amount
|
||||
// of dependencies used by Cranelift.
|
||||
impl std::error::Error for VerifierErrors {}
|
||||
|
||||
impl VerifierErrors {
|
||||
|
||||
@@ -192,6 +192,8 @@ pub enum ModuleError {
|
||||
Backend(anyhow::Error),
|
||||
}
|
||||
|
||||
// This is manually implementing Error and Display instead of using thiserror to reduce the amount
|
||||
// of dependencies used by Cranelift.
|
||||
impl std::error::Error for ModuleError {
|
||||
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
|
||||
match self {
|
||||
|
||||
Reference in New Issue
Block a user