Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lifetime parameters #48

Open
yberreby opened this Issue Sep 24, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@yberreby
Copy link

yberreby commented Sep 24, 2016

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
@Yamakaky

This comment has been minimized.

Copy link
Collaborator

Yamakaky commented Nov 17, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.