Add rustfix to inconsistent_digit_grouping test
This commit is contained in:
parent
40d9f1d9f4
commit
87407c5e5f
15
tests/ui/inconsistent_digit_grouping.fixed
Normal file
15
tests/ui/inconsistent_digit_grouping.fixed
Normal file
@ -0,0 +1,15 @@
|
||||
// run-rustfix
|
||||
#[warn(clippy::inconsistent_digit_grouping)]
|
||||
#[allow(unused_variables, clippy::excessive_precision)]
|
||||
fn main() {
|
||||
let good = (
|
||||
123,
|
||||
1_234,
|
||||
1_2345_6789,
|
||||
123_f32,
|
||||
1_234.12_f32,
|
||||
1_234.123_4_f32,
|
||||
1.123_456_7_f32,
|
||||
);
|
||||
let bad = (123_456, 12_345_678, 1_234_567, 1_234.567_8_f32, 1.234_567_8_f32);
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
// run-rustfix
|
||||
#[warn(clippy::inconsistent_digit_grouping)]
|
||||
#[allow(unused_variables)]
|
||||
#[allow(unused_variables, clippy::excessive_precision)]
|
||||
fn main() {
|
||||
let good = (
|
||||
123,
|
||||
|
@ -1,5 +1,5 @@
|
||||
error: digits grouped inconsistently by underscores
|
||||
--> $DIR/inconsistent_digit_grouping.rs:13:16
|
||||
--> $DIR/inconsistent_digit_grouping.rs:14:16
|
||||
|
|
||||
LL | let bad = (1_23_456, 1_234_5678, 1234_567, 1_234.5678_f32, 1.234_5678_f32);
|
||||
| ^^^^^^^^ help: consider: `123_456`
|
||||
@ -7,25 +7,25 @@ LL | let bad = (1_23_456, 1_234_5678, 1234_567, 1_234.5678_f32, 1.234_5678_f
|
||||
= note: `-D clippy::inconsistent-digit-grouping` implied by `-D warnings`
|
||||
|
||||
error: digits grouped inconsistently by underscores
|
||||
--> $DIR/inconsistent_digit_grouping.rs:13:26
|
||||
--> $DIR/inconsistent_digit_grouping.rs:14:26
|
||||
|
|
||||
LL | let bad = (1_23_456, 1_234_5678, 1234_567, 1_234.5678_f32, 1.234_5678_f32);
|
||||
| ^^^^^^^^^^ help: consider: `12_345_678`
|
||||
|
||||
error: digits grouped inconsistently by underscores
|
||||
--> $DIR/inconsistent_digit_grouping.rs:13:38
|
||||
--> $DIR/inconsistent_digit_grouping.rs:14:38
|
||||
|
|
||||
LL | let bad = (1_23_456, 1_234_5678, 1234_567, 1_234.5678_f32, 1.234_5678_f32);
|
||||
| ^^^^^^^^ help: consider: `1_234_567`
|
||||
|
||||
error: digits grouped inconsistently by underscores
|
||||
--> $DIR/inconsistent_digit_grouping.rs:13:48
|
||||
--> $DIR/inconsistent_digit_grouping.rs:14:48
|
||||
|
|
||||
LL | let bad = (1_23_456, 1_234_5678, 1234_567, 1_234.5678_f32, 1.234_5678_f32);
|
||||
| ^^^^^^^^^^^^^^ help: consider: `1_234.567_8_f32`
|
||||
|
||||
error: digits grouped inconsistently by underscores
|
||||
--> $DIR/inconsistent_digit_grouping.rs:13:64
|
||||
--> $DIR/inconsistent_digit_grouping.rs:14:64
|
||||
|
|
||||
LL | let bad = (1_23_456, 1_234_5678, 1234_567, 1_234.5678_f32, 1.234_5678_f32);
|
||||
| ^^^^^^^^^^^^^^ help: consider: `1.234_567_8_f32`
|
||||
|
Loading…
x
Reference in New Issue
Block a user