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