3 ms·
There's actually a lint specifically intended for that already. `float_arithmetic`: https://rust-lang.github.io/rust-clippy/master/#float_arithmetic https://ru
by ssokolow 6y ago
There's actually a lint specifically intended for that already. `float_arithmetic`:
https://rust-lang.github.io/rust-clippy/master/#float_arithmetic https://rust-lang.github.io/rust-clippy/master/#float_arithm...
# What it does
Checks for float arithmetic.
# Why is this bad
For some embedded systems or kernel development, it can be useful to rule out floating-point numbers.
- dathinab 6y agoThanks, nice, but for the kernel use case it would need to be part of rustc.
- zaarn 6y agoSimply install clippy and call "clippy-driver" instead of "rustc", which will handle this. Clippy is largely the lints that haven't either made it into rustc or are fairly edge-case-y.
- littlestymaar 5y agoWhy? The Rust-for-Linux team already made Clippy a requirement for Rust kernel code. For niche configuration that are really project-specific like this, it makes total sense to use external tooling to ensure the guidelines are respected, it doesn't need to be the compiler enforcing these guidelines.