-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
zero_ptr lint detected for any lazy_static code #1580
Comments
I also can't seem to silence the lint with |
nevermind, the |
Unfortunately, just changing |
I don't see any reason why |
It is a const fn already. The issue is that using const fns requires opting in to the feature. |
Disabling inside macro invocations sounds like a hack; could constexpr context be detected? At least this case (which is what causes false positives in lazy_static): (static|static mut) <var>: <ty> = /* disable zero_ptr for RHS of the assignment */; |
yea, but you also have static FOO: fn() -> *const i32 = {
fn f() -> *const i32 {
0 as *const i32
}
f
}; Should not lint, ... I'm working on trying to fully fix this instead of going for a partial fix. The same issues apply to other lints like |
Automatically closed but reopening as long as it's not fully fixed (see #1610). |
Allow lints to check Bodys directly r? @eddyb babysteps towards fixing https://github.com/Manishearth/rust-clippy/issues/1580 (disable certain lints in const environments, since they make no sense there (yet))
Allow lints to check Bodys directly r? @eddyb babysteps towards fixing https://github.com/Manishearth/rust-clippy/issues/1580 (disable certain lints in const environments, since they make no sense there (yet))
Allow lints to check Bodys directly r? @eddyb babysteps towards fixing https://github.com/Manishearth/rust-clippy/issues/1580 (disable certain lints in const environments, since they make no sense there (yet))
Allow lints to check Bodys directly r? @eddyb babysteps towards fixing https://github.com/Manishearth/rust-clippy/issues/1580 (disable certain lints in const environments, since they make no sense there (yet))
Allow lints to check Bodys directly r? @eddyb babysteps towards fixing https://github.com/Manishearth/rust-clippy/issues/1580 (disable certain lints in const environments, since they make no sense there (yet))
Allow lints to check Bodys directly r? @eddyb babysteps towards fixing https://github.com/Manishearth/rust-clippy/issues/1580 (disable certain lints in const environments, since they make no sense there (yet))
Allow lints to check Bodys directly r? @eddyb babysteps towards fixing https://github.com/Manishearth/rust-clippy/issues/1580 (disable certain lints in const environments, since they make no sense there (yet))
Allow lints to check Bodys directly r? @eddyb babysteps towards fixing https://github.com/Manishearth/rust-clippy/issues/1580 (disable certain lints in const environments, since they make no sense there (yet))
I assume this is fixed now as all the relevant PR's are merged. |
I'm running
clippy v0.0.115
This code
Is generating this error repeatedely:
This never happened before. All I did was update clippy to the latest version.
The text was updated successfully, but these errors were encountered: