4 #[allow(unused_assignments)]
5 #[deny(misrefactored_assign_op)]
8 a += a + 1; //~ ERROR variable appears on both sides of an assignment operation
9 //~^ HELP replace it with
10 //~| SUGGESTION a += 1
11 a += 1 + a; //~ ERROR variable appears on both sides of an assignment operation
12 //~^ HELP replace it with
13 //~| SUGGESTION a += 1
14 a -= a - 1; //~ ERROR variable appears on both sides of an assignment operation
15 //~^ HELP replace it with
16 //~| SUGGESTION a -= 1
17 a *= a * 99; //~ ERROR variable appears on both sides of an assignment operation
18 //~^ HELP replace it with
19 //~| SUGGESTION a *= 99
20 a *= 42 * a; //~ ERROR variable appears on both sides of an assignment operation
21 //~^ HELP replace it with
22 //~| SUGGESTION a *= 42
23 a /= a / 2; //~ ERROR variable appears on both sides of an assignment operation
24 //~^ HELP replace it with
25 //~| SUGGESTION a /= 2
26 a %= a % 5; //~ ERROR variable appears on both sides of an assignment operation
27 //~^ HELP replace it with
28 //~| SUGGESTION a %= 5
29 a &= a & 1; //~ ERROR variable appears on both sides of an assignment operation
30 //~^ HELP replace it with
31 //~| SUGGESTION a &= 1
38 // check that we don't lint on op assign impls, because that's just the way to impl them
40 use std::ops::{Mul, MulAssign};
42 #[derive(Copy, Clone, Debug, PartialEq)]
45 impl Mul<i64> for Wrap {
48 fn mul(self, rhs: i64) -> Self {
53 impl MulAssign<i64> for Wrap {
54 fn mul_assign(&mut self, rhs: i64) {