From 3ad3c51cee1d36d01fd145d6a45e33cff2bc12a1 Mon Sep 17 00:00:00 2001 From: Jubilee Young Date: Sun, 19 Sep 2021 16:10:29 -0700 Subject: [PATCH] Demote float_cmp to pedantic --- clippy_lints/src/lib.rs | 3 +-- clippy_lints/src/misc.rs | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs index 59d87aa96dcf..8a73824ce4c4 100644 --- a/clippy_lints/src/lib.rs +++ b/clippy_lints/src/lib.rs @@ -1132,6 +1132,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf: LintId::of(methods::INEFFICIENT_TO_STRING), LintId::of(methods::MAP_FLATTEN), LintId::of(methods::MAP_UNWRAP_OR), + LintId::of(misc::FLOAT_CMP), LintId::of(misc::USED_UNDERSCORE_BINDING), LintId::of(misc_early::UNSEPARATED_LITERAL_SUFFIX), LintId::of(mut_mut::MUT_MUT), @@ -1365,7 +1366,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf: LintId::of(minmax::MIN_MAX), LintId::of(misc::CMP_NAN), LintId::of(misc::CMP_OWNED), - LintId::of(misc::FLOAT_CMP), LintId::of(misc::MODULO_ONE), LintId::of(misc::SHORT_CIRCUIT_STATEMENT), LintId::of(misc::TOPLEVEL_REF_ARG), @@ -1729,7 +1729,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf: LintId::of(methods::ZST_OFFSET), LintId::of(minmax::MIN_MAX), LintId::of(misc::CMP_NAN), - LintId::of(misc::FLOAT_CMP), LintId::of(misc::MODULO_ONE), LintId::of(non_octal_unix_permissions::NON_OCTAL_UNIX_PERMISSIONS), LintId::of(open_options::NONSENSICAL_OPEN_OPTIONS), diff --git a/clippy_lints/src/misc.rs b/clippy_lints/src/misc.rs index 538fa4e1678f..0f32cd9164e2 100644 --- a/clippy_lints/src/misc.rs +++ b/clippy_lints/src/misc.rs @@ -113,7 +113,7 @@ declare_clippy_lint! { /// if (y - x).abs() > error_margin { } /// ``` pub FLOAT_CMP, - correctness, + pedantic, "using `==` or `!=` on float values instead of comparing difference with an epsilon" }