Skip to content

Commit e402ddd

Browse files
committed
Auto merge of #4736 - flip1995:icu_mul_add, r=matthiaskrgr
Move manual_mul_add into nursery Addresses #4735 changelog: Move [`manual_mul_add`] into nursery
2 parents b3ecd48 + 1e1d45a commit e402ddd

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

clippy_lints/src/lib.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1183,7 +1183,6 @@ pub fn register_plugins(store: &mut lint::LintStore, sess: &Session, conf: &Conf
11831183
LintId::of(&misc_early::UNNEEDED_FIELD_PATTERN),
11841184
LintId::of(&misc_early::UNNEEDED_WILDCARD_PATTERN),
11851185
LintId::of(&misc_early::ZERO_PREFIXED_LITERAL),
1186-
LintId::of(&mul_add::MANUAL_MUL_ADD),
11871186
LintId::of(&mut_reference::UNNECESSARY_MUT_PASSED),
11881187
LintId::of(&mutable_debug_assertion::DEBUG_ASSERT_WITH_MUT_CALL),
11891188
LintId::of(&mutex_atomic::MUTEX_ATOMIC),
@@ -1527,7 +1526,6 @@ pub fn register_plugins(store: &mut lint::LintStore, sess: &Session, conf: &Conf
15271526
LintId::of(&methods::OR_FUN_CALL),
15281527
LintId::of(&methods::SINGLE_CHAR_PATTERN),
15291528
LintId::of(&misc::CMP_OWNED),
1530-
LintId::of(&mul_add::MANUAL_MUL_ADD),
15311529
LintId::of(&mutex_atomic::MUTEX_ATOMIC),
15321530
LintId::of(&redundant_clone::REDUNDANT_CLONE),
15331531
LintId::of(&slow_vector_initialization::SLOW_VECTOR_INITIALIZATION),
@@ -1546,6 +1544,7 @@ pub fn register_plugins(store: &mut lint::LintStore, sess: &Session, conf: &Conf
15461544
LintId::of(&attrs::EMPTY_LINE_AFTER_OUTER_ATTR),
15471545
LintId::of(&fallible_impl_from::FALLIBLE_IMPL_FROM),
15481546
LintId::of(&missing_const_for_fn::MISSING_CONST_FOR_FN),
1547+
LintId::of(&mul_add::MANUAL_MUL_ADD),
15491548
LintId::of(&mutex_atomic::MUTEX_INTEGER),
15501549
LintId::of(&needless_borrow::NEEDLESS_BORROW),
15511550
LintId::of(&path_buf_push_overwrite::PATH_BUF_PUSH_OVERWRITE),

clippy_lints/src/mul_add.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ declare_clippy_lint! {
1515
/// `c`. Depending on the target architecture, `mul_add()` may be more
1616
/// performant.
1717
///
18-
/// **Known problems:** None.
18+
/// **Known problems:** This lint can emit semantic incorrect suggestions.
19+
/// For example, for `a * b * c + d` the suggestion `a * b.mul_add(c, d)`
20+
/// is emitted, which is equivalent to `a * (b * c + d)`. (#4735)
1921
///
2022
/// **Example:**
2123
///
@@ -35,7 +37,7 @@ declare_clippy_lint! {
3537
/// let foo = a.mul_add(b, c);
3638
/// ```
3739
pub MANUAL_MUL_ADD,
38-
perf,
40+
nursery,
3941
"Using `a.mul_add(b, c)` for floating points has higher numerical precision than `a * b + c`"
4042
}
4143

src/lintlist/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,7 @@ pub const ALL_LINTS: [Lint; 332] = [
961961
},
962962
Lint {
963963
name: "manual_mul_add",
964-
group: "perf",
964+
group: "nursery",
965965
desc: "Using `a.mul_add(b, c)` for floating points has higher numerical precision than `a * b + c`",
966966
deprecation: None,
967967
module: "mul_add",

0 commit comments

Comments
 (0)