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

Check for static items with 'static lifetime #4138

Closed
tesuji opened this issue May 25, 2019 · 0 comments · Fixed by #4162
Closed

Check for static items with 'static lifetime #4138

tesuji opened this issue May 25, 2019 · 0 comments · Fixed by #4162
Labels
C-enhancement Category: Enhancement of lints, like adding more cases or adding help messages good-first-issue These issues are a good way to get started with Clippy

Comments

@tesuji
Copy link
Contributor

tesuji commented May 25, 2019

It just like https://rust-lang.github.io/rust-clippy/master/index.html#const_static_lifetime but for static item.

Example

pub static FOO: &'static [u8] = b"bar";

Could be rewritten as:

pub static FOO: &[u8] = b"bar";

cargo clippy -V output: clippy 0.0.212 (60a609a 2019-05-17)

@tesuji tesuji changed the title Check for static items with 'static lifetie Check for static items with 'static lifetime May 25, 2019
@oli-obk oli-obk added good-first-issue These issues are a good way to get started with Clippy C-enhancement Category: Enhancement of lints, like adding more cases or adding help messages labels May 25, 2019
bors added a commit that referenced this issue Jun 14, 2019
Add lint for statics with explicit static lifetime.

changelog: Add lint for statics with explicit static lifetime, fixes #4138.
bors added a commit that referenced this issue Jun 14, 2019
Add lint for statics with explicit static lifetime.

changelog: Add lint for statics with explicit static lifetime, fixes #4138.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: Enhancement of lints, like adding more cases or adding help messages good-first-issue These issues are a good way to get started with Clippy
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants