| #![warn(clippy::excessive_precision)] |
| #![allow(overflowing_literals, clippy::print_literal, clippy::useless_vec)] |
| |
| fn main() { |
| // Overly specified constants |
| let _: f32 = 1.012_345_7; |
| //~^ excessive_precision |
| let _: f64 = 1.012_345_678_901_234_6; |
| //~^ excessive_precision |
| const _: f32 = 1.012345678901234567890; |
| const _: f64 = 1.012345678901234567890; |
| |
| static STATIC1: f32 = 1.012345678901234567890; |
| static STATIC2: f64 = 1.012345678901234567890; |
| |
| static mut STATIC_MUT1: f32 = 1.012345678901234567890; |
| static mut STATIC_MUT2: f64 = 1.012345678901234567890; |
| } |
| |
| trait ExcessivelyPreciseTrait { |
| // Overly specified constants |
| const GOOD1: f32 = 1.012345678901234567890; |
| const GOOD2: f64 = 1.012345678901234567890; |
| } |
| |
| struct ExcessivelyPreciseStruct; |
| |
| impl ExcessivelyPreciseStruct { |
| // Overly specified constants |
| const GOOD1: f32 = 1.012345678901234567890; |
| const GOOD2: f64 = 1.012345678901234567890; |
| } |