Skip to content

No fix suggestion for extra_unused_lifetimes #5374

Open
@jsgf

Description

@jsgf

Resolving extra_unused_lifetimes seems pretty straightforward - just remove the lifetimes, but the diagnostic clippy emits doesn't have any fix suggestions. Is there any reason for it not to?

For example: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=1af0f2b1989bfb76f491af4a115e67a0

pub fn look_at_my_unused_lifetimes<'a>(msg: &str) {
    println!("print a msg: {}", msg);
}

produces the diagnostic:

    Checking playground v0.0.1 (/playground)
warning: this lifetime isn't used in the function definition
 --> src/lib.rs:1:36
  |
1 | pub fn look_at_my_unused_lifetimes<'a>(msg: &str) {
  |                                    ^^
  |
  = note: `#[warn(clippy::extra_unused_lifetimes)]` on by default
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes

    Finished dev [unoptimized + debuginfo] target(s) in 0.55s

which points out the problem clearly, but no fix suggestion for auto-replacement.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: Enhancement of lints, like adding more cases or adding help messagesE-mediumCall for participation: Medium difficulty level problem and requires some initial experience.E-needs-testCall for participation: writing testsL-suggestionLint: Improving, adding or fixing lint suggestions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions