quick-error icon indicating copy to clipboard operation
quick-error copied to clipboard

Allow the `extra_unused_lifetimes` lint in the context impl

Open tertsdiepraam opened this issue 3 years ago • 0 comments

Hi!

In the uutils/coreutils repository, we ran into this issue: https://github.com/uutils/coreutils/pull/3687. The minimum reproducible case is:

quick_error! {
    #[derive(Debug)]
    enum Error {
        SomeError(s: String, err: io::Error) {
            context(s: String, err: io::Error) -> (s, err)
        }
    }
}

and then running cargo clippy -- -D warnings. In this case, an impl is generated with the lifetime 'a, which is not used, since all the arguments to the context are owned, which triggers the clippy lint.

This might be a fairly niche issue, since we treat clippy warnings as errors, but it would still be nice to fix this upstream. Allowing the lint on the context impl fixed the issue.

Edit: I should probably mention that we started seeing this problem with Rust 1.62.

tertsdiepraam avatar Jul 01 '22 14:07 tertsdiepraam