use std::error;
use std::fmt;
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum Error {
NoLayoutForOpaqueBlob,
InstantiationOfOpaqueType,
ReferenceButCouldNotRecord,
}
impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str(match *self {
Error::NoLayoutForOpaqueBlob => {
"Tried to generate an opaque blob, but had no layout"
}
Error::InstantiationOfOpaqueType => {
"Instantiation of opaque template type or partial template \
specialization"
}
Error::ReferenceButCouldNotRecord => {
"Type was a reference in a context where we only expected other types"
}
})
}
}
impl error::Error for Error {}
pub type Result<T> = ::std::result::Result<T, Error>;