1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
use std::fmt::{Display, Formatter, Result as FmtResult};
use cst::ParseError;
#[derive(Debug, Fail)]
pub enum LoadError {
Io(::std::io::Error),
Parse(ParseError),
}
impl Display for LoadError {
fn fmt(&self, fmt: &mut Formatter) -> FmtResult {
match *self {
LoadError::Io(ref err) => write!(fmt, "{}", err),
LoadError::Parse(ref err) => write!(fmt, "{}", err.clone().map_token(|(_n, t)| t)),
}
}
}
#[derive(Debug, Fail)]
pub enum ResolutionError {
#[fail(display = "Insufficiently instantiated arguments to {}/{}", _0, _1)]
InsufficientlyInstantiatedArgs(&'static str, usize),
#[fail(display = "Type error in arguments to {}/{}", _0, _1)]
TypeError(&'static str, usize),
}