-
Notifications
You must be signed in to change notification settings - Fork 747
Clippy and const and &'static references #1612
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
Comments
I was just about to open this issue myself <3 |
Is it redundant in all the rust versions that bindgen supports? I'm not sure we intentionally keep our generated code clippy-warning-free, but improvements are welcome of course. |
Clearly the generated module should simply insert #![allow(clippy::redundant_static_lifetimes)] If you're targeting a rust version that allows tool attributes :P But more seriously, the looking through the releases file, seems like 1.17 made the change here https://github.com/rust-lang/rust/blob/master/RELEASES.md#version-1170-2017-04-27 |
Ok, we could add a |
I was about to open this issue and then found it already here. Is this still considered a TODO? |
Constant and static declaration have a 'static live time by default, that is already elided since 1.17. Clippy complains on this kind of strings that are present in the generated code. This patch remove the 'static live time for those strings. Fix rust-lang#1612 Signed-off-by: Alberto Planas <[email protected]>
Constant and static declaration have a 'static live time by default, that is already elided since 1.17. Clippy complains on this kind of strings that are present in the generated code. This patch remove the 'static live time for those strings. Fix rust-lang#1612 Signed-off-by: Alberto Planas <[email protected]>
Constant and static declaration have a 'static live time by default, that is already elided since 1.17. Clippy complains on this kind of strings that are present in the generated code. This patch remove the 'static live time for those strings. Fix rust-lang#1612 Signed-off-by: Alberto Planas <[email protected]>
Constant and static declaration have a 'static live time by default, that is already elided since 1.17. Clippy complains on this kind of strings that are present in the generated code. This patch remove the 'static live time for those strings when rustc > 1.17 via a new added RustFeature. Fix rust-lang#1612 Signed-off-by: Alberto Planas <[email protected]>
Constant and static declaration have a 'static live time by default, that is already elided since 1.17. Clippy complains on this kind of strings that are present in the generated code. This patch remove the 'static live time for those strings when rustc > 1.17 via a new added RustFeature. Fix rust-lang#1612 Signed-off-by: Alberto Planas <[email protected]>
Constant and static declaration have a 'static live time by default, that is already elided since 1.17. Clippy complains on this kind of strings that are present in the generated code. This patch remove the 'static live time for those strings when rustc > 1.17 via a new added RustFeature. Fix rust-lang#1612 Signed-off-by: Alberto Planas <[email protected]>
Constant and static declaration have a 'static live time by default, that is already elided since 1.17. Clippy complains on this kind of strings that are present in the generated code. This patch remove the 'static live time for those strings when rustc > 1.17 via a new added RustFeature. Fix rust-lang#1612 Signed-off-by: Alberto Planas <[email protected]>
Constant and static declaration have a 'static live time by default, that is already elided since 1.17. Clippy complains on this kind of strings that are present in the generated code. This patch remove the 'static live time for those strings when rustc > 1.17 via a new added RustFeature. Fix #1612 Signed-off-by: Alberto Planas <[email protected]>
Input C/C++ Header
Bindgen Invocation
I don't think that I've tweaked anything here.
Actual Results
This results in warnings from clippy when compiled with
#![deny(warnings)]
. The use of&'static
tripsclippy::redundant_static_lifetimes
.Expected Results
As explained in the lint, the use of
&'static
is redundant and can be removed.The text was updated successfully, but these errors were encountered: