Skip to content

Commit 3f9b837

Browse files
authored
Merge pull request rust-lang#2953 from dwijnand/misrefactored_assign_op-known-problem-doc
Expand on misrefactored_assign_op known problems
2 parents 25e0a08 + 70f5bb1 commit 3f9b837

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

clippy_lints/src/assign_ops.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,10 @@ declare_clippy_lint! {
5151
/// **Why is this bad?** Most likely these are bugs where one meant to write `a
5252
/// op= b`.
5353
///
54-
/// **Known problems:** Someone might actually mean `a op= a op b`, but that
55-
/// should rather be written as `a = (2 * a) op b` where applicable.
54+
/// **Known problems:** Clippy cannot know for sure if `a op= a op b` should have
55+
/// been `a = a op a op b` or `a = a op b`/`a op= b`. Therefore it suggests both.
56+
/// If `a op= a op b` is really the correct behaviour it should be
57+
/// written as `a = a op a op b` as it's less confusing.
5658
///
5759
/// **Example:**
5860
/// ```rust

0 commit comments

Comments
 (0)