1 2 3 4 5 6 7 8 9 10 11 12 13
use std::error::Error; use std::fmt::Display; #[derive(Clone, Debug, PartialEq)] pub struct TypeCheckError; impl Display for TypeCheckError { fn fmt(&self, formatter: &mut std::fmt::Formatter) -> Result<(), std::fmt::Error> { write!(formatter, "{:?}", self) } } impl Error for TypeCheckError {}