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

Support non-static lifetime inside error(transparent) #134

Merged
merged 2 commits into from May 22, 2021
Merged

Commits on May 22, 2021

  1. Add regression test for issue 113

    This does not currently compile.
    
        error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
          --> tests/test_transparent.rs:63:14
           |
        63 |     #[derive(Error, Debug)]
           |              ^^^^^
           |
        note: first, the lifetime cannot outlive the lifetime `'a` as defined on the impl at 65:18...
          --> tests/test_transparent.rs:65:18
           |
        65 |     struct Error<'a> {
           |                  ^^
        note: ...so that the types are compatible
          --> tests/test_transparent.rs:63:14
           |
        63 |     #[derive(Error, Debug)]
           |              ^^^^^
           = note: expected `&test_non_static::ErrorKind<'_>`
                      found `&test_non_static::ErrorKind<'a>`
           = note: but, the lifetime must be valid for the static lifetime...
        note: ...so that the type `test_non_static::ErrorKind<'_>` will meet its required lifetime bounds
          --> tests/test_transparent.rs:63:14
           |
        63 |     #[derive(Error, Debug)]
           |              ^^^^^
           = note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)
    dtolnay committed May 22, 2021
    Copy the full SHA
    51a1ff6 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    1ed8751 View commit details
    Browse the repository at this point in the history