Skip to content

Commit 370433f

Browse files
committed
Requested test cleanup
1 parent 4ee9d02 commit 370433f

File tree

2 files changed

+7
-54
lines changed

2 files changed

+7
-54
lines changed

tests/ui/literals.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#![warn(clippy::large_digit_groups)]
22
#![warn(clippy::mixed_case_hex_literals)]
3-
#![warn(clippy::unseparated_literal_suffix)]
43
#![warn(clippy::zero_prefixed_literal)]
4+
#![allow(clippy::unseparated_literal_suffix)]
55
#![allow(dead_code)]
66

77
fn main() {
@@ -15,15 +15,6 @@ fn main() {
1515
let fail2 = 0xabCD_isize;
1616
let fail_multi_zero = 000_123usize;
1717

18-
let ok6 = 1234_i32;
19-
let ok7 = 1234_f32;
20-
let ok8 = 1234_isize;
21-
let fail3 = 1234i32;
22-
let fail4 = 1234u32;
23-
let fail5 = 1234isize;
24-
let fail6 = 1234usize;
25-
let fail7 = 1.5f32;
26-
2718
let ok9 = 0;
2819
let ok10 = 0_i64;
2920
let fail8 = 0123;

tests/ui/literals.stderr

Lines changed: 6 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,6 @@ error: inconsistent casing in hexadecimal literal
1818
LL | let fail2 = 0xabCD_isize;
1919
| ^^^^^^^^^^^^
2020

21-
error: integer type suffix should be separated by an underscore
22-
--> $DIR/literals.rs:16:27
23-
|
24-
LL | let fail_multi_zero = 000_123usize;
25-
| ^^^^^^^^^^^^ help: add an underscore: `000_123_usize`
26-
|
27-
= note: `-D clippy::unseparated-literal-suffix` implied by `-D warnings`
28-
2921
error: this is a decimal constant
3022
--> $DIR/literals.rs:16:27
3123
|
@@ -42,38 +34,8 @@ help: if you mean to use an octal constant, use `0o`
4234
LL | let fail_multi_zero = 0o123usize;
4335
| ^^^^^^^^^^
4436

45-
error: integer type suffix should be separated by an underscore
46-
--> $DIR/literals.rs:21:17
47-
|
48-
LL | let fail3 = 1234i32;
49-
| ^^^^^^^ help: add an underscore: `1234_i32`
50-
51-
error: integer type suffix should be separated by an underscore
52-
--> $DIR/literals.rs:22:17
53-
|
54-
LL | let fail4 = 1234u32;
55-
| ^^^^^^^ help: add an underscore: `1234_u32`
56-
57-
error: integer type suffix should be separated by an underscore
58-
--> $DIR/literals.rs:23:17
59-
|
60-
LL | let fail5 = 1234isize;
61-
| ^^^^^^^^^ help: add an underscore: `1234_isize`
62-
63-
error: integer type suffix should be separated by an underscore
64-
--> $DIR/literals.rs:24:17
65-
|
66-
LL | let fail6 = 1234usize;
67-
| ^^^^^^^^^ help: add an underscore: `1234_usize`
68-
69-
error: float type suffix should be separated by an underscore
70-
--> $DIR/literals.rs:25:17
71-
|
72-
LL | let fail7 = 1.5f32;
73-
| ^^^^^^ help: add an underscore: `1.5_f32`
74-
7537
error: this is a decimal constant
76-
--> $DIR/literals.rs:29:17
38+
--> $DIR/literals.rs:20:17
7739
|
7840
LL | let fail8 = 0123;
7941
| ^^^^
@@ -87,32 +49,32 @@ LL | let fail8 = 0o123;
8749
| ^^^^^
8850

8951
error: digit groups should be smaller
90-
--> $DIR/literals.rs:40:18
52+
--> $DIR/literals.rs:31:18
9153
|
9254
LL | let fail13 = 0x1_23456_78901_usize;
9355
| ^^^^^^^^^^^^^^^^^^^^^ help: consider: `0x0123_4567_8901_usize`
9456
|
9557
= note: `-D clippy::large-digit-groups` implied by `-D warnings`
9658

9759
error: digits grouped inconsistently by underscores
98-
--> $DIR/literals.rs:42:18
60+
--> $DIR/literals.rs:33:18
9961
|
10062
LL | let fail19 = 12_3456_21;
10163
| ^^^^^^^^^^ help: consider: `12_345_621`
10264
|
10365
= note: `-D clippy::inconsistent-digit-grouping` implied by `-D warnings`
10466

10567
error: digits grouped inconsistently by underscores
106-
--> $DIR/literals.rs:43:18
68+
--> $DIR/literals.rs:34:18
10769
|
10870
LL | let fail22 = 3__4___23;
10971
| ^^^^^^^^^ help: consider: `3_423`
11072

11173
error: digits grouped inconsistently by underscores
112-
--> $DIR/literals.rs:44:18
74+
--> $DIR/literals.rs:35:18
11375
|
11476
LL | let fail23 = 3__16___23;
11577
| ^^^^^^^^^^ help: consider: `31_623`
11678

117-
error: aborting due to 15 previous errors
79+
error: aborting due to 9 previous errors
11880

0 commit comments

Comments
 (0)