Skip to content

Commit be34bc4

Browse files
committed
Downgrade unreadable_literal to pedantic
1 parent 7907abe commit be34bc4

7 files changed

+21
-16
lines changed

clippy_lints/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,6 +1098,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
10981098
LintId::of(&items_after_statements::ITEMS_AFTER_STATEMENTS),
10991099
LintId::of(&large_stack_arrays::LARGE_STACK_ARRAYS),
11001100
LintId::of(&literal_representation::LARGE_DIGIT_GROUPS),
1101+
LintId::of(&literal_representation::UNREADABLE_LITERAL),
11011102
LintId::of(&loops::EXPLICIT_INTO_ITER_LOOP),
11021103
LintId::of(&loops::EXPLICIT_ITER_LOOP),
11031104
LintId::of(&macro_use::MACRO_USE_IMPORTS),
@@ -1219,7 +1220,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
12191220
LintId::of(&lifetimes::NEEDLESS_LIFETIMES),
12201221
LintId::of(&literal_representation::INCONSISTENT_DIGIT_GROUPING),
12211222
LintId::of(&literal_representation::MISTYPED_LITERAL_SUFFIXES),
1222-
LintId::of(&literal_representation::UNREADABLE_LITERAL),
12231223
LintId::of(&loops::EMPTY_LOOP),
12241224
LintId::of(&loops::EXPLICIT_COUNTER_LOOP),
12251225
LintId::of(&loops::FOR_KV_MAP),
@@ -1428,7 +1428,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
14281428
LintId::of(&len_zero::LEN_ZERO),
14291429
LintId::of(&let_if_seq::USELESS_LET_IF_SEQ),
14301430
LintId::of(&literal_representation::INCONSISTENT_DIGIT_GROUPING),
1431-
LintId::of(&literal_representation::UNREADABLE_LITERAL),
14321431
LintId::of(&loops::EMPTY_LOOP),
14331432
LintId::of(&loops::FOR_KV_MAP),
14341433
LintId::of(&loops::NEEDLESS_RANGE_LOOP),

clippy_lints/src/literal_representation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ declare_clippy_lint! {
2727
/// let x: u64 = 61864918973511;
2828
/// ```
2929
pub UNREADABLE_LITERAL,
30-
style,
30+
pedantic,
3131
"long integer literal without underscores"
3232
}
3333

src/lintlist/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2294,7 +2294,7 @@ pub static ref ALL_LINTS: Vec<Lint> = vec![
22942294
},
22952295
Lint {
22962296
name: "unreadable_literal",
2297-
group: "style",
2297+
group: "pedantic",
22982298
desc: "long integer literal without underscores",
22992299
deprecation: None,
23002300
module: "literal_representation",

tests/ui/approx_const.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#[warn(clippy::approx_constant)]
2-
#[allow(unused, clippy::shadow_unrelated, clippy::similar_names, clippy::unreadable_literal)]
2+
#[allow(unused, clippy::shadow_unrelated, clippy::similar_names)]
33
fn main() {
44
let my_e = 2.7182;
55
let almost_e = 2.718;

tests/ui/inconsistent_digit_grouping.fixed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// run-rustfix
22
#[warn(clippy::inconsistent_digit_grouping)]
3+
#[deny(clippy::unreadable_literal)]
34
#[allow(unused_variables, clippy::excessive_precision)]
45
fn main() {
56
macro_rules! mac1 {

tests/ui/inconsistent_digit_grouping.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// run-rustfix
22
#[warn(clippy::inconsistent_digit_grouping)]
3+
#[deny(clippy::unreadable_literal)]
34
#[allow(unused_variables, clippy::excessive_precision)]
45
fn main() {
56
macro_rules! mac1 {

tests/ui/inconsistent_digit_grouping.stderr

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,67 @@
11
error: digits grouped inconsistently by underscores
2-
--> $DIR/inconsistent_digit_grouping.rs:25:16
2+
--> $DIR/inconsistent_digit_grouping.rs:26:16
33
|
44
LL | let bad = (1_23_456, 1_234_5678, 1234_567, 1_234.5678_f32, 1.234_5678_f32);
55
| ^^^^^^^^ help: consider: `123_456`
66
|
77
= note: `-D clippy::inconsistent-digit-grouping` implied by `-D warnings`
88

99
error: digits grouped inconsistently by underscores
10-
--> $DIR/inconsistent_digit_grouping.rs:25:26
10+
--> $DIR/inconsistent_digit_grouping.rs:26:26
1111
|
1212
LL | let bad = (1_23_456, 1_234_5678, 1234_567, 1_234.5678_f32, 1.234_5678_f32);
1313
| ^^^^^^^^^^ help: consider: `12_345_678`
1414

1515
error: digits grouped inconsistently by underscores
16-
--> $DIR/inconsistent_digit_grouping.rs:25:38
16+
--> $DIR/inconsistent_digit_grouping.rs:26:38
1717
|
1818
LL | let bad = (1_23_456, 1_234_5678, 1234_567, 1_234.5678_f32, 1.234_5678_f32);
1919
| ^^^^^^^^ help: consider: `1_234_567`
2020

2121
error: digits grouped inconsistently by underscores
22-
--> $DIR/inconsistent_digit_grouping.rs:25:48
22+
--> $DIR/inconsistent_digit_grouping.rs:26:48
2323
|
2424
LL | let bad = (1_23_456, 1_234_5678, 1234_567, 1_234.5678_f32, 1.234_5678_f32);
2525
| ^^^^^^^^^^^^^^ help: consider: `1_234.567_8_f32`
2626

2727
error: digits grouped inconsistently by underscores
28-
--> $DIR/inconsistent_digit_grouping.rs:25:64
28+
--> $DIR/inconsistent_digit_grouping.rs:26:64
2929
|
3030
LL | let bad = (1_23_456, 1_234_5678, 1234_567, 1_234.5678_f32, 1.234_5678_f32);
3131
| ^^^^^^^^^^^^^^ help: consider: `1.234_567_8_f32`
3232

3333
error: long literal lacking separators
34-
--> $DIR/inconsistent_digit_grouping.rs:28:13
34+
--> $DIR/inconsistent_digit_grouping.rs:29:13
3535
|
3636
LL | let _ = 0x100000;
3737
| ^^^^^^^^ help: consider: `0x0010_0000`
3838
|
39-
= note: `-D clippy::unreadable-literal` implied by `-D warnings`
39+
note: the lint level is defined here
40+
--> $DIR/inconsistent_digit_grouping.rs:3:8
41+
|
42+
LL | #[deny(clippy::unreadable_literal)]
43+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
4044

4145
error: long literal lacking separators
42-
--> $DIR/inconsistent_digit_grouping.rs:29:13
46+
--> $DIR/inconsistent_digit_grouping.rs:30:13
4347
|
4448
LL | let _ = 0x1000000;
4549
| ^^^^^^^^^ help: consider: `0x0100_0000`
4650

4751
error: long literal lacking separators
48-
--> $DIR/inconsistent_digit_grouping.rs:30:13
52+
--> $DIR/inconsistent_digit_grouping.rs:31:13
4953
|
5054
LL | let _ = 0x10000000;
5155
| ^^^^^^^^^^ help: consider: `0x1000_0000`
5256

5357
error: long literal lacking separators
54-
--> $DIR/inconsistent_digit_grouping.rs:31:13
58+
--> $DIR/inconsistent_digit_grouping.rs:32:13
5559
|
5660
LL | let _ = 0x100000000_u64;
5761
| ^^^^^^^^^^^^^^^ help: consider: `0x0001_0000_0000_u64`
5862

5963
error: digits grouped inconsistently by underscores
60-
--> $DIR/inconsistent_digit_grouping.rs:34:18
64+
--> $DIR/inconsistent_digit_grouping.rs:35:18
6165
|
6266
LL | let _: f32 = 1_23_456.;
6367
| ^^^^^^^^^ help: consider: `123_456.`

0 commit comments

Comments
 (0)