-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thing
Description
The inconsistent_digit_grouping
is inconsistent when a floating point exponent is used. e.g. 1.234E1
.
fn main() {
let a = 1.025_011_10E0;
let b = 1.025_011_10_E0;
println!("{}", a);
println!("{}", b);
}
I expected to see this happen: No warning is displayed for either literal.
Instead, this happened: A inconsistent_digit_grouping
warning is displayed only for the literal assigned to b
.
It looks like the final _
before the E
binds to the fractional portion of the number rather than the exponent. It would be good if an _
before the E
did not group with the fractional portion so that an _
can be used to make the E
stand out from the digits.
Meta
cargo clippy -V
: e.g. clippy 0.0.212 (f455e46 2020-06-20)rustc -Vv
:rustc 1.46.0-nightly (f455e46ea 2020-06-20) binary: rustc commit-hash: f455e46eae1a227d735091091144601b467e1565 commit-date: 2020-06-20 host: x86_64-unknown-linux-gnu release: 1.46.0-nightly LLVM version: 10.0
Metadata
Metadata
Assignees
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thing