checkpoint; builds again

This commit is contained in:
2023-12-02 22:38:44 -08:00
parent 71228b9e09
commit 93cac44a99
16 changed files with 1200 additions and 1194 deletions

View File

@@ -41,6 +41,8 @@ pub enum BackendError {
Write(#[from] cranelift_object::object::write::Error),
#[error("Invalid type cast from {from} to {to}")]
InvalidTypeCast { from: PrimitiveType, to: Type },
#[error("Unknown string constant '{0}")]
UnknownString(ArcIntern<String>),
}
impl From<BackendError> for Diagnostic<usize> {
@@ -69,6 +71,8 @@ impl From<BackendError> for Diagnostic<usize> {
BackendError::InvalidTypeCast { from, to } => Diagnostic::error().with_message(
format!("Internal error trying to cast from {} to {}", from, to),
),
BackendError::UnknownString(str) => Diagnostic::error()
.with_message(format!("Unknown string found trying to compile: '{}'", str)),
}
}
}
@@ -119,6 +123,11 @@ impl PartialEq for BackendError {
} => from1 == from2 && to1 == to2,
_ => false,
},
BackendError::UnknownString(a) => match other {
BackendError::UnknownString(b) => a == b,
_ => false,
},
}
}
}