rust-clippy/tests/ui-toml/lint_decimal_readability/test.rs
Joshua Nelson ac9dd36856 Don't abort compilation after giving a lint error
The only reason to use `abort_if_errors` is when the program is so broken that either:
1. later passes get confused and ICE
2. any diagnostics from later passes would be noise

This is never the case for lints, because the compiler has to be able to deal with `allow`-ed lints.
So it can continue to lint and compile even if there are lint errors.
2021-11-08 01:22:28 +00:00

23 lines
589 B
Rust

#![allow(clippy::excessive_precision)]
#[deny(clippy::unreadable_literal)]
fn allow_inconsistent_digit_grouping() {
#![allow(clippy::inconsistent_digit_grouping)]
let _pass1 = 100_200_300.123456789;
}
fn main() {
allow_inconsistent_digit_grouping();
let _pass1 = 100_200_300.100_200_300;
let _pass2 = 1.123456789;
let _pass3 = 1.0;
let _pass4 = 10000.00001;
let _pass5 = 1.123456789e1;
// due to clippy::inconsistent-digit-grouping
let _fail1 = 100_200_300.123456789;
// fail due to the integer part
let _fail2 = 100200300.300200100;
}