Skip to content

Commit 45936a6

Browse files
Uplift excessive_precision to the correctness category
1 parent 5524528 commit 45936a6

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

clippy_lints/src/excessive_precision.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ declare_clippy_lint! {
2222
///
2323
/// ```rust
2424
/// // Bad
25-
/// let v: f32 = 0.123_456_789_9;
26-
/// println!("{}", v); // 0.123_456_789
25+
/// let a: f32 = 0.123_456_789_9; // 0.123_456_789
26+
/// let b: f32 = 16_777_217.0; // 16_777_216.0
2727
///
2828
/// // Good
29-
/// let v: f64 = 0.123_456_789_9;
30-
/// println!("{}", v); // 0.123_456_789_9
29+
/// let a: f64 = 0.123_456_789_9;
30+
/// let b: f64 = 16_777_216.0;
3131
/// ```
3232
pub EXCESSIVE_PRECISION,
33-
style,
33+
correctness,
3434
"excessive precision for float literal"
3535
}
3636

clippy_lints/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1386,7 +1386,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
13861386
LintId::of(&enum_variants::MODULE_INCEPTION),
13871387
LintId::of(&eq_op::OP_REF),
13881388
LintId::of(&eta_reduction::REDUNDANT_CLOSURE),
1389-
LintId::of(&excessive_precision::EXCESSIVE_PRECISION),
13901389
LintId::of(&formatting::SUSPICIOUS_ASSIGNMENT_FORMATTING),
13911390
LintId::of(&formatting::SUSPICIOUS_ELSE_FORMATTING),
13921391
LintId::of(&formatting::SUSPICIOUS_UNARY_OP_FORMATTING),
@@ -1567,6 +1566,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
15671566
LintId::of(&enum_clike::ENUM_CLIKE_UNPORTABLE_VARIANT),
15681567
LintId::of(&eq_op::EQ_OP),
15691568
LintId::of(&erasing_op::ERASING_OP),
1569+
LintId::of(&excessive_precision::EXCESSIVE_PRECISION),
15701570
LintId::of(&formatting::POSSIBLE_MISSING_COMMA),
15711571
LintId::of(&functions::NOT_UNSAFE_PTR_ARG_DEREF),
15721572
LintId::of(&indexing_slicing::OUT_OF_BOUNDS_INDEXING),

src/lintlist/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ pub const ALL_LINTS: [Lint; 355] = [
492492
},
493493
Lint {
494494
name: "excessive_precision",
495-
group: "style",
495+
group: "correctness",
496496
desc: "excessive precision for float literal",
497497
deprecation: None,
498498
module: "excessive_precision",

0 commit comments

Comments
 (0)