RS.CLIPPY.LEGACY_NUMERIC_CONSTANTS
Checks for usage of legacy std numeric constants and methods
This checker is a Clippy lint created by The Rust Project Contributors. The documentation shown here is a copy of the original documentation for: legacy_numeric_constants. Copyright ©2025 The Rust Team. All rights reserved.
What it does
Checks for usage of <integer>::max_value(), std::<integer>::MAX,
std::<float>::EPSILON, etc.
Why is this bad?
All of these have been superseded by the associated constants on their respective types,
such as i128::MAX. These legacy items may be deprecated in a future version of rust.
Example
let eps = std::f32::EPSILON;
Use instead:
let eps = f32::EPSILON;
Configuration
-
msrv: The minimum rust version that the project supports. Defaults to therust-versionfield inCargo.toml(default:
current version)