Skip to content

extra_unused_lifetimes does not warn on spurious for<'a> #13812

Open
@jrose-signal

Description

@jrose-signal

I had the following code

pub async fn run<F>(body: impl for<'a> FnOnce(PathBuf) -> F)
where
    F: Future<Output = ()>,
{
  unimplemented!()
}

A colleague correctly noted I forgot to remove the lifetime qualification after changing from Path to PathBuf (though I probably didn't even need it before, I was experimenting with things). Clippy could have told me that too, but it didn't. (Nor does it for the longer-standing syntax of &mut dyn for<'a> FnMut(PathBuf).)

I think extra_unused_lifetimes is the lint that should have gotten it, but maybe not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-false-negativeIssue: The lint should have been triggered on code, but wasn't

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions