4 #[derive(Clone, Debug)]
14 pub type EvalResult<T> = Result<T, EvalError>;
16 impl Error for EvalError {
17 fn description(&self) -> &str {
19 EvalError::DanglingPointerDeref => "dangling pointer was dereferenced",
20 EvalError::InvalidBool => "invalid boolean value read",
21 EvalError::PointerOutOfBounds => "pointer offset outside bounds of allocation",
22 EvalError::ReadPointerAsBytes =>
23 "a raw memory access tried to access part of a pointer value as raw bytes",
24 EvalError::ReadBytesAsPointer =>
25 "attempted to interpret some raw bytes as a pointer address",
26 EvalError::InvalidPointerMath =>
27 "attempted to do math or a comparison on pointers into different allocations",
31 fn cause(&self) -> Option<&Error> { None }
34 impl fmt::Display for EvalError {
35 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
36 write!(f, "{}", self.description())