#[allow(raw_pointer_derive)] across Rust versions


#1

In earlier versions of Rust, this was required in some places. In more recent versions, you get this warning:

warning: lint raw_pointer_derive has been removed: using derive
with raw pointers is ok

I’d like to support older versions of Rust, but not have warnings in newer versions. My current best idea is to use rustc_version, a build script, and cfg_attr. Is there something better?


#2

I believe that lint was previously only warn by default, so you can just ignore the lint entirely. It’ll trigger on old rust versions but still build, and new versions won’t get any messages at all.


#3

At least on 1.4.0 it’s denied by default. I went ahead with the build script for now, seems to work!


#4

It’s unlikely to have ever been deny by default. Do you have #![deny(warnings)] somewhere?


#5

Ah yes, I do. Seems like with #![deny(warnings)] I’ll have to go the build script route?