Add global CtonResult and CtonError types.
These are for reporting the overall result of compiling a function.
This commit is contained in:
@@ -59,6 +59,7 @@ use ir::instructions::{InstructionFormat, BranchInfo, ResolvedConstraint, CallIn
|
||||
use ir::{types, Function, ValueDef, Ebb, Inst, SigRef, FuncRef, ValueList, JumpTable, StackSlot,
|
||||
Value, Type};
|
||||
use Context;
|
||||
use std::error as std_error;
|
||||
use std::fmt::{self, Display, Formatter};
|
||||
use std::result;
|
||||
use std::collections::BTreeSet;
|
||||
@@ -78,6 +79,12 @@ impl Display for Error {
|
||||
}
|
||||
}
|
||||
|
||||
impl std_error::Error for Error {
|
||||
fn description(&self) -> &str {
|
||||
&self.message
|
||||
}
|
||||
}
|
||||
|
||||
/// Verifier result.
|
||||
pub type Result<T> = result::Result<T, Error>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user