Fixes #1619: Properly bubble up errors when seeing an unexpected type during lowering.

This commit is contained in:
Benjamin Bouvier
2020-04-28 17:40:16 +02:00
parent c9b27b484e
commit 698dc9c401
6 changed files with 45 additions and 32 deletions

View File

@@ -1,6 +1,7 @@
//! Result and error types representing the outcome of compiling a function.
use crate::verifier::VerifierErrors;
use std::string::String;
use thiserror::Error;
/// A compilation error.
@@ -31,6 +32,12 @@ pub enum CodegenError {
#[error("Code for function is too large")]
CodeTooLarge,
/// Something is not supported by the code generator. This might be an indication that a
/// feature is used without explicitly enabling it, or that something is temporarily
/// unsupported by a given target backend.
#[error("Unsupported feature: {0}")]
Unsupported(String),
/// A failure to map Cranelift register representation to a DWARF register representation.
#[cfg(feature = "unwind")]
#[error("Register mapping error")]