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