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
use std::result;
use ir;
use parser;
#[derive(Debug, Fail, PartialEq)]
pub enum Error {
#[fail(display = "parser error")]
Parser(#[cause] parser::Error),
#[fail(display = "IR error")]
Ir(#[cause] ir::Error),
}
pub type Result<A> = result::Result<A, Error>;
impl From<ir::Error> for Error {
fn from(err: ir::Error) -> Self {
Error::Ir(err)
}
}
impl From<parser::Error> for Error {
fn from(err: parser::Error) -> Self {
Error::Parser(err)
}
}