]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/assign_ops2.stderr
Rollup merge of #105602 - RalfJung:read-convenience, r=oli-obk
[rust.git] / src / tools / clippy / tests / ui / assign_ops2.stderr
1 error: variable appears on both sides of an assignment operation
2   --> $DIR/assign_ops2.rs:7:5
3    |
4 LL |     a += a + 1;
5    |     ^^^^^^^^^^
6    |
7    = note: `-D clippy::misrefactored-assign-op` implied by `-D warnings`
8 help: did you mean `a = a + 1` or `a = a + a + 1`? Consider replacing it with
9    |
10 LL |     a += 1;
11    |     ~~~~~~
12 help: or
13    |
14 LL |     a = a + a + 1;
15    |     ~~~~~~~~~~~~~
16
17 error: variable appears on both sides of an assignment operation
18   --> $DIR/assign_ops2.rs:8:5
19    |
20 LL |     a += 1 + a;
21    |     ^^^^^^^^^^
22    |
23 help: did you mean `a = a + 1` or `a = a + 1 + a`? Consider replacing it with
24    |
25 LL |     a += 1;
26    |     ~~~~~~
27 help: or
28    |
29 LL |     a = a + 1 + a;
30    |     ~~~~~~~~~~~~~
31
32 error: variable appears on both sides of an assignment operation
33   --> $DIR/assign_ops2.rs:9:5
34    |
35 LL |     a -= a - 1;
36    |     ^^^^^^^^^^
37    |
38 help: did you mean `a = a - 1` or `a = a - (a - 1)`? Consider replacing it with
39    |
40 LL |     a -= 1;
41    |     ~~~~~~
42 help: or
43    |
44 LL |     a = a - (a - 1);
45    |     ~~~~~~~~~~~~~~~
46
47 error: variable appears on both sides of an assignment operation
48   --> $DIR/assign_ops2.rs:10:5
49    |
50 LL |     a *= a * 99;
51    |     ^^^^^^^^^^^
52    |
53 help: did you mean `a = a * 99` or `a = a * a * 99`? Consider replacing it with
54    |
55 LL |     a *= 99;
56    |     ~~~~~~~
57 help: or
58    |
59 LL |     a = a * a * 99;
60    |     ~~~~~~~~~~~~~~
61
62 error: variable appears on both sides of an assignment operation
63   --> $DIR/assign_ops2.rs:11:5
64    |
65 LL |     a *= 42 * a;
66    |     ^^^^^^^^^^^
67    |
68 help: did you mean `a = a * 42` or `a = a * 42 * a`? Consider replacing it with
69    |
70 LL |     a *= 42;
71    |     ~~~~~~~
72 help: or
73    |
74 LL |     a = a * 42 * a;
75    |     ~~~~~~~~~~~~~~
76
77 error: variable appears on both sides of an assignment operation
78   --> $DIR/assign_ops2.rs:12:5
79    |
80 LL |     a /= a / 2;
81    |     ^^^^^^^^^^
82    |
83 help: did you mean `a = a / 2` or `a = a / (a / 2)`? Consider replacing it with
84    |
85 LL |     a /= 2;
86    |     ~~~~~~
87 help: or
88    |
89 LL |     a = a / (a / 2);
90    |     ~~~~~~~~~~~~~~~
91
92 error: variable appears on both sides of an assignment operation
93   --> $DIR/assign_ops2.rs:13:5
94    |
95 LL |     a %= a % 5;
96    |     ^^^^^^^^^^
97    |
98 help: did you mean `a = a % 5` or `a = a % (a % 5)`? Consider replacing it with
99    |
100 LL |     a %= 5;
101    |     ~~~~~~
102 help: or
103    |
104 LL |     a = a % (a % 5);
105    |     ~~~~~~~~~~~~~~~
106
107 error: variable appears on both sides of an assignment operation
108   --> $DIR/assign_ops2.rs:14:5
109    |
110 LL |     a &= a & 1;
111    |     ^^^^^^^^^^
112    |
113 help: did you mean `a = a & 1` or `a = a & a & 1`? Consider replacing it with
114    |
115 LL |     a &= 1;
116    |     ~~~~~~
117 help: or
118    |
119 LL |     a = a & a & 1;
120    |     ~~~~~~~~~~~~~
121
122 error: variable appears on both sides of an assignment operation
123   --> $DIR/assign_ops2.rs:15:5
124    |
125 LL |     a *= a * a;
126    |     ^^^^^^^^^^
127    |
128 help: did you mean `a = a * a` or `a = a * a * a`? Consider replacing it with
129    |
130 LL |     a *= a;
131    |     ~~~~~~
132 help: or
133    |
134 LL |     a = a * a * a;
135    |     ~~~~~~~~~~~~~
136
137 error: manual implementation of an assign operation
138   --> $DIR/assign_ops2.rs:52:5
139    |
140 LL |     buf = buf + cows.clone();
141    |     ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `buf += cows.clone()`
142    |
143    = note: `-D clippy::assign-op-pattern` implied by `-D warnings`
144
145 error: aborting due to 10 previous errors
146