mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-10 15:14:29 +00:00
Add run-rustfix to large_digit_groups
This commit is contained in:
parent
256b641976
commit
fb90fcb610
3 changed files with 38 additions and 14 deletions
23
tests/ui/large_digit_groups.fixed
Normal file
23
tests/ui/large_digit_groups.fixed
Normal file
|
@ -0,0 +1,23 @@
|
|||
// run-rustfix
|
||||
#[warn(clippy::large_digit_groups)]
|
||||
#[allow(unused_variables)]
|
||||
fn main() {
|
||||
let good = (
|
||||
0b1011_i64,
|
||||
0o1_234_u32,
|
||||
0x1_234_567,
|
||||
1_2345_6789,
|
||||
1234_f32,
|
||||
1_234.12_f32,
|
||||
1_234.123_f32,
|
||||
1.123_4_f32,
|
||||
);
|
||||
let bad = (
|
||||
0b11_0110_i64,
|
||||
0x0123_4567_8901_usize,
|
||||
123_456_f32,
|
||||
123_456.12_f32,
|
||||
123_456.123_45_f64,
|
||||
123_456.123_456_f64,
|
||||
);
|
||||
}
|
|
@ -1,3 +1,4 @@
|
|||
// run-rustfix
|
||||
#[warn(clippy::large_digit_groups)]
|
||||
#[allow(unused_variables)]
|
||||
fn main() {
|
||||
|
@ -16,7 +17,7 @@ fn main() {
|
|||
0x1_23456_78901_usize,
|
||||
1_23456_f32,
|
||||
1_23456.12_f32,
|
||||
1_23456.12345_f32,
|
||||
1_23456.12345_6_f32,
|
||||
1_23456.12345_f64,
|
||||
1_23456.12345_6_f64,
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error: digit groups should be smaller
|
||||
--> $DIR/large_digit_groups.rs:15:9
|
||||
--> $DIR/large_digit_groups.rs:16:9
|
||||
|
|
||||
LL | 0b1_10110_i64,
|
||||
| ^^^^^^^^^^^^^ help: consider: `0b11_0110_i64`
|
||||
|
@ -7,34 +7,34 @@ LL | 0b1_10110_i64,
|
|||
= note: `-D clippy::large-digit-groups` implied by `-D warnings`
|
||||
|
||||
error: digit groups should be smaller
|
||||
--> $DIR/large_digit_groups.rs:16:9
|
||||
--> $DIR/large_digit_groups.rs:17:9
|
||||
|
|
||||
LL | 0x1_23456_78901_usize,
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ help: consider: `0x0123_4567_8901_usize`
|
||||
|
||||
error: digit groups should be smaller
|
||||
--> $DIR/large_digit_groups.rs:17:9
|
||||
--> $DIR/large_digit_groups.rs:18:9
|
||||
|
|
||||
LL | 1_23456_f32,
|
||||
| ^^^^^^^^^^^ help: consider: `123_456_f32`
|
||||
|
||||
error: digit groups should be smaller
|
||||
--> $DIR/large_digit_groups.rs:18:9
|
||||
--> $DIR/large_digit_groups.rs:19:9
|
||||
|
|
||||
LL | 1_23456.12_f32,
|
||||
| ^^^^^^^^^^^^^^ help: consider: `123_456.12_f32`
|
||||
|
||||
error: digit groups should be smaller
|
||||
--> $DIR/large_digit_groups.rs:19:9
|
||||
|
|
||||
LL | 1_23456.12345_f32,
|
||||
| ^^^^^^^^^^^^^^^^^ help: consider: `123_456.123_45_f32`
|
||||
|
||||
error: digit groups should be smaller
|
||||
--> $DIR/large_digit_groups.rs:20:9
|
||||
|
|
||||
LL | 1_23456.12345_6_f32,
|
||||
| ^^^^^^^^^^^^^^^^^^^ help: consider: `123_456.123_456_f32`
|
||||
LL | 1_23456.12345_f64,
|
||||
| ^^^^^^^^^^^^^^^^^ help: consider: `123_456.123_45_f64`
|
||||
|
||||
error: digit groups should be smaller
|
||||
--> $DIR/large_digit_groups.rs:21:9
|
||||
|
|
||||
LL | 1_23456.12345_6_f64,
|
||||
| ^^^^^^^^^^^^^^^^^^^ help: consider: `123_456.123_456_f64`
|
||||
|
||||
error: aborting due to 6 previous errors
|
||||
|
||||
|
|
Loading…
Reference in a new issue