Skip to content

Cannot silence lint "warning: unnecessary lifetime parameter" #8860

Closed
@ritchie46

Description

@ritchie46

Description

Due to macro's its sometimes not easy to adapt a warning.

This code creates the warning that the lifetime can be replaced directly:

pub fn foo<'a>(_s: &'a str) where 'a: 'static { }
warning: unnecessary lifetime parameter `'a`
 --> src/lib.rs:2:37
  |
2 | pub fn foo<'a>(_s: &'a str) where 'a: 'static { }
  |                                     ^^
  |
  = help: you can use the `'static` lifetime directly, in place of `'a`

warning: `playground` (lib) generated 1 warning
    Finished dev [unoptimized + debuginfo] target(s) in 1.19s

However there does not seem to be a tag that allows us to silence it.

Version

rustc 1.63.0-nightly (c52b9c10b 2022-05-16)
binary: rustc
commit-hash: c52b9c10bfb5164015eb977ff498e0597ae63eb1
commit-date: 2022-05-16
host: x86_64-unknown-linux-gnu
release: 1.63.0-nightly
LLVM version: 14.0.4

Additional Labels

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions