#[non_exhaustive]pub enum IselError {
Invalid(ValidationError),
NoBody(FuncId),
Unsupported {
func: FuncId,
what: &'static str,
},
Mir(MirError),
}Expand description
Why a function could not be selected.
§Examples
use backend_lang::isel::IselError;
use backend_lang::Options;
use ir_lang::{Linkage, Module, Signature, Type};
let mut m = Module::new("m");
let f = m.declare_function("f", &Signature::new(&[Type::F64], &[]), Linkage::Export)?;
let mut b = m.build(f)?;
b.ret(&[])?;
let err = backend_lang::isel::select(&m, f, &Options::sysv()).unwrap_err();
assert!(matches!(err, IselError::Unsupported { .. }));Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Invalid(ValidationError)
The module does not validate (ir-lang’s Module::validate).
NoBody(FuncId)
The function handle is not in the module, or it is an import.
Unsupported
A construct this release does not select, and why.
Mir(MirError)
Building the MIR failed (a 32-bit table limit, or an internal inconsistency reported rather than panicking).
Trait Implementations§
impl Eq for IselError
Source§impl Error for IselError
impl Error for IselError
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()
impl StructuralPartialEq for IselError
Auto Trait Implementations§
impl Freeze for IselError
impl RefUnwindSafe for IselError
impl Send for IselError
impl Sync for IselError
impl Unpin for IselError
impl UnsafeUnpin for IselError
impl UnwindSafe for IselError
Blanket Implementations§
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