From 1e1d45a0055eb7c67972e698d7dcd86378ce9ebe Mon Sep 17 00:00:00 2001 From: flip1995 Date: Sat, 26 Oct 2019 19:56:36 +0200 Subject: [PATCH] Move manual_mul_add into nursery --- clippy_lints/src/lib.rs | 3 +-- clippy_lints/src/mul_add.rs | 6 ++++-- src/lintlist/mod.rs | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs index 005b734c16fea..717451903243a 100644 --- a/clippy_lints/src/lib.rs +++ b/clippy_lints/src/lib.rs @@ -1183,7 +1183,6 @@ pub fn register_plugins(store: &mut lint::LintStore, sess: &Session, conf: &Conf LintId::of(&misc_early::UNNEEDED_FIELD_PATTERN), LintId::of(&misc_early::UNNEEDED_WILDCARD_PATTERN), LintId::of(&misc_early::ZERO_PREFIXED_LITERAL), - LintId::of(&mul_add::MANUAL_MUL_ADD), LintId::of(&mut_reference::UNNECESSARY_MUT_PASSED), LintId::of(&mutable_debug_assertion::DEBUG_ASSERT_WITH_MUT_CALL), LintId::of(&mutex_atomic::MUTEX_ATOMIC), @@ -1527,7 +1526,6 @@ pub fn register_plugins(store: &mut lint::LintStore, sess: &Session, conf: &Conf LintId::of(&methods::OR_FUN_CALL), LintId::of(&methods::SINGLE_CHAR_PATTERN), LintId::of(&misc::CMP_OWNED), - LintId::of(&mul_add::MANUAL_MUL_ADD), LintId::of(&mutex_atomic::MUTEX_ATOMIC), LintId::of(&redundant_clone::REDUNDANT_CLONE), LintId::of(&slow_vector_initialization::SLOW_VECTOR_INITIALIZATION), @@ -1546,6 +1544,7 @@ pub fn register_plugins(store: &mut lint::LintStore, sess: &Session, conf: &Conf LintId::of(&attrs::EMPTY_LINE_AFTER_OUTER_ATTR), LintId::of(&fallible_impl_from::FALLIBLE_IMPL_FROM), LintId::of(&missing_const_for_fn::MISSING_CONST_FOR_FN), + LintId::of(&mul_add::MANUAL_MUL_ADD), LintId::of(&mutex_atomic::MUTEX_INTEGER), LintId::of(&needless_borrow::NEEDLESS_BORROW), LintId::of(&path_buf_push_overwrite::PATH_BUF_PUSH_OVERWRITE), diff --git a/clippy_lints/src/mul_add.rs b/clippy_lints/src/mul_add.rs index 02e403eee1801..5263bfbd357a0 100644 --- a/clippy_lints/src/mul_add.rs +++ b/clippy_lints/src/mul_add.rs @@ -15,7 +15,9 @@ declare_clippy_lint! { /// `c`. Depending on the target architecture, `mul_add()` may be more /// performant. /// - /// **Known problems:** None. + /// **Known problems:** This lint can emit semantic incorrect suggestions. + /// For example, for `a * b * c + d` the suggestion `a * b.mul_add(c, d)` + /// is emitted, which is equivalent to `a * (b * c + d)`. (#4735) /// /// **Example:** /// @@ -35,7 +37,7 @@ declare_clippy_lint! { /// let foo = a.mul_add(b, c); /// ``` pub MANUAL_MUL_ADD, - perf, + nursery, "Using `a.mul_add(b, c)` for floating points has higher numerical precision than `a * b + c`" } diff --git a/src/lintlist/mod.rs b/src/lintlist/mod.rs index 48ca368f5a933..a053cf8bef0c2 100644 --- a/src/lintlist/mod.rs +++ b/src/lintlist/mod.rs @@ -961,7 +961,7 @@ pub const ALL_LINTS: [Lint; 332] = [ }, Lint { name: "manual_mul_add", - group: "perf", + group: "nursery", desc: "Using `a.mul_add(b, c)` for floating points has higher numerical precision than `a * b + c`", deprecation: None, module: "mul_add",