Add global CtonResult and CtonError types.

These are for reporting the overall result of compiling a function.
This commit is contained in:
Jakob Stoklund Olesen
2017-04-21 10:55:12 -07:00
parent 4cf3babda0
commit 83381dadc5
3 changed files with 76 additions and 0 deletions

View File

@@ -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>;