Closed Apanatshka closed 6 years ago
Not sure how to best address this, since the warning is about a line of code that runs as a constexpr.
ah... so you can't use ptr::null()
because it's not const
? 😞
EDIT: actually, it is const
, so maybe you can use it?
The problem is that calling a const is a unstable feature.
Oh, right. Well, then this issue is blocked until calling const functions is stabilised.
This lint is no longer triggering as of Rust 1.29.0-nightly and Clippy 0.0.212.
#![cfg_attr(feature = "cargo-clippy", deny(zero_ptr))]
#[macro_use]
extern crate lazy_static;
lazy_static! {
static ref S: u8 = 0;
}
fn main() {}
When I use lazy_static, for every static ref I create I get a clippy warning: