rust-bindgen
rust-bindgen copied to clipboard
Generated INFINITY & NEG_ INFINITY are invalid in Rust 1.79
Input C/C++ Header
#define POSITIVE_INFINITE (1.0/0.0)
#define NEGATIVE_INFINITE (-1.0/0.0)
Actual Results
pub const POSITIVE_INFINITE: f64 = ::std::f64::INFINITY;
pub const NEGATIVE_INFINITE: f64 = ::std::f64::NEG_INFINITY;
Expected Results
pub const POSITIVE_INFINITE: f64 = f64::INFINITY;
pub const NEGATIVE_INFINITE: f64 = f64::NEG_INFINITY;
Due to new lint rule: https://rust-lang.github.io/rust-clippy/master/index.html#/legacy_numeric_constants
Source code seems to be: https://github.com/rust-lang/rust-bindgen/blob/cf9b02f57cc6138f60b4d35a5ff109b433dd8238/bindgen/codegen/helpers.rs#L325