I'm trying to use error-chain in the context of a simple Lisp interpreter. One of the errors I want to handle has a lifetime parameter, but error-chain does not seem to offer a way to specify generic lifetime parameters. Is it possible?
/// LALRPOP parse error.
pub type LPParseError<'input> = ::lalrpop_util::ParseError<usize, (usize, &'input str), ()>;
// 'input should be declared somewhere around here.
error_chain!{
errors {
ParseError(e: LPParseError<'input>) {
description("failed to parse")
display("parse error: '{}'", e)
}
}
}
error[E0261]: use of undeclared lifetime name `'input`
--> errors.rs:8:36
|
8 | ParseError(e: LPParseError<'input>) {
| ^^^^^^ undeclared lifetime
I'm trying to use
error-chain
in the context of a simple Lisp interpreter. One of the errors I want to handle has a lifetime parameter, buterror-chain
does not seem to offer a way to specify generic lifetime parameters. Is it possible?