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

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

Closed
ritchie46 opened this issue May 21, 2022 · 3 comments
Closed

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

ritchie46 opened this issue May 21, 2022 · 3 comments

Comments

@ritchie46
Copy link

ritchie46 commented May 21, 2022

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

@Alexendoo
Copy link
Member

This is from rustc rust-lang/rust#96956

@ritchie46
Copy link
Author

Yes, I backposted it here as I was not sure it belonged to clippy or rustc.

@oskgo
Copy link

oskgo commented Jan 25, 2024

This is not a clippy issue, and the issue no longer reproduces since it was fixed in rust-lang/rust#108230, so this should be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants