From 6ad7a92ff87a007912e0d9803fd6b80fddbdb965 Mon Sep 17 00:00:00 2001 From: Dale Wijnand Date: Tue, 24 Jul 2018 08:39:18 +0100 Subject: [PATCH] Expand on misrefactored_assign_op known problems --- clippy_lints/src/assign_ops.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/clippy_lints/src/assign_ops.rs b/clippy_lints/src/assign_ops.rs index c2d0ccd1534e..d61515d533f0 100644 --- a/clippy_lints/src/assign_ops.rs +++ b/clippy_lints/src/assign_ops.rs @@ -51,8 +51,10 @@ declare_clippy_lint! { /// **Why is this bad?** Most likely these are bugs where one meant to write `a /// op= b`. /// -/// **Known problems:** Someone might actually mean `a op= a op b`, but that -/// should rather be written as `a = (2 * a) op b` where applicable. +/// **Known problems:** Clippy cannot know for sure if `a op= a op b` should have +/// been `a = a op a op b` or `a = a op b`/`a op= b`. Therefore it suggests both. +/// If `a op= a op b` is really the correct behaviour then +/// rewrite it as `a = (2 * a) op b` as it's less confusing. /// /// **Example:** /// ```rust