]>
Commit | Line | Data |
---|---|---|
923072b8 | 1 | error: this operation has no effect |
c620b35d | 2 | --> tests/ui/identity_op.rs:44:5 |
f20569fa XL |
3 | | |
4 | LL | x + 0; | |
923072b8 | 5 | | ^^^^^ help: consider reducing it to: `x` |
f20569fa XL |
6 | | |
7 | = note: `-D clippy::identity-op` implied by `-D warnings` | |
781aab86 | 8 | = help: to override `-D warnings` add `#[allow(clippy::identity_op)]` |
f20569fa | 9 | |
923072b8 | 10 | error: this operation has no effect |
c620b35d | 11 | --> tests/ui/identity_op.rs:46:5 |
f20569fa XL |
12 | | |
13 | LL | x + (1 - 1); | |
923072b8 | 14 | | ^^^^^^^^^^^ help: consider reducing it to: `x` |
f20569fa | 15 | |
923072b8 | 16 | error: this operation has no effect |
c620b35d | 17 | --> tests/ui/identity_op.rs:49:5 |
f20569fa XL |
18 | | |
19 | LL | 0 + x; | |
923072b8 | 20 | | ^^^^^ help: consider reducing it to: `x` |
f20569fa | 21 | |
923072b8 | 22 | error: this operation has no effect |
c620b35d | 23 | --> tests/ui/identity_op.rs:53:5 |
f20569fa XL |
24 | | |
25 | LL | x | (0); | |
923072b8 | 26 | | ^^^^^^^ help: consider reducing it to: `x` |
f20569fa | 27 | |
923072b8 | 28 | error: this operation has no effect |
c620b35d | 29 | --> tests/ui/identity_op.rs:57:5 |
f20569fa XL |
30 | | |
31 | LL | x * 1; | |
923072b8 | 32 | | ^^^^^ help: consider reducing it to: `x` |
f20569fa | 33 | |
923072b8 | 34 | error: this operation has no effect |
c620b35d | 35 | --> tests/ui/identity_op.rs:59:5 |
f20569fa XL |
36 | | |
37 | LL | 1 * x; | |
923072b8 | 38 | | ^^^^^ help: consider reducing it to: `x` |
f20569fa | 39 | |
923072b8 | 40 | error: this operation has no effect |
c620b35d | 41 | --> tests/ui/identity_op.rs:66:5 |
f20569fa XL |
42 | | |
43 | LL | -1 & x; | |
923072b8 | 44 | | ^^^^^^ help: consider reducing it to: `x` |
f20569fa | 45 | |
923072b8 | 46 | error: this operation has no effect |
c620b35d | 47 | --> tests/ui/identity_op.rs:70:5 |
f20569fa XL |
48 | | |
49 | LL | u & 255; | |
923072b8 | 50 | | ^^^^^^^ help: consider reducing it to: `u` |
f20569fa | 51 | |
923072b8 | 52 | error: this operation has no effect |
c620b35d | 53 | --> tests/ui/identity_op.rs:74:5 |
f20569fa XL |
54 | | |
55 | LL | 42 << 0; | |
923072b8 | 56 | | ^^^^^^^ help: consider reducing it to: `42` |
f20569fa | 57 | |
923072b8 | 58 | error: this operation has no effect |
c620b35d | 59 | --> tests/ui/identity_op.rs:76:5 |
f20569fa XL |
60 | | |
61 | LL | 1 >> 0; | |
923072b8 | 62 | | ^^^^^^ help: consider reducing it to: `1` |
f20569fa | 63 | |
923072b8 | 64 | error: this operation has no effect |
c620b35d | 65 | --> tests/ui/identity_op.rs:78:5 |
f20569fa XL |
66 | | |
67 | LL | 42 >> 0; | |
923072b8 | 68 | | ^^^^^^^ help: consider reducing it to: `42` |
f20569fa | 69 | |
923072b8 | 70 | error: this operation has no effect |
c620b35d | 71 | --> tests/ui/identity_op.rs:80:5 |
a2a8927a XL |
72 | | |
73 | LL | &x >> 0; | |
9c376795 | 74 | | ^^^^^^^ help: consider reducing it to: `x` |
a2a8927a | 75 | |
923072b8 | 76 | error: this operation has no effect |
c620b35d | 77 | --> tests/ui/identity_op.rs:82:5 |
a2a8927a XL |
78 | | |
79 | LL | x >> &0; | |
923072b8 | 80 | | ^^^^^^^ help: consider reducing it to: `x` |
a2a8927a | 81 | |
923072b8 | 82 | error: this operation has no effect |
c620b35d | 83 | --> tests/ui/identity_op.rs:90:5 |
04454e1e FG |
84 | | |
85 | LL | 2 % 3; | |
923072b8 | 86 | | ^^^^^ help: consider reducing it to: `2` |
04454e1e | 87 | |
923072b8 | 88 | error: this operation has no effect |
c620b35d | 89 | --> tests/ui/identity_op.rs:92:5 |
04454e1e FG |
90 | | |
91 | LL | -2 % 3; | |
923072b8 | 92 | | ^^^^^^ help: consider reducing it to: `-2` |
04454e1e | 93 | |
923072b8 | 94 | error: this operation has no effect |
c620b35d | 95 | --> tests/ui/identity_op.rs:94:5 |
04454e1e FG |
96 | | |
97 | LL | 2 % -3 + x; | |
923072b8 | 98 | | ^^^^^^ help: consider reducing it to: `2` |
04454e1e | 99 | |
923072b8 | 100 | error: this operation has no effect |
c620b35d | 101 | --> tests/ui/identity_op.rs:96:5 |
04454e1e FG |
102 | | |
103 | LL | -2 % -3 + x; | |
923072b8 | 104 | | ^^^^^^^ help: consider reducing it to: `-2` |
04454e1e | 105 | |
923072b8 | 106 | error: this operation has no effect |
c620b35d | 107 | --> tests/ui/identity_op.rs:98:9 |
04454e1e FG |
108 | | |
109 | LL | x + 1 % 3; | |
923072b8 | 110 | | ^^^^^ help: consider reducing it to: `1` |
04454e1e | 111 | |
923072b8 | 112 | error: this operation has no effect |
c620b35d | 113 | --> tests/ui/identity_op.rs:107:5 |
04454e1e FG |
114 | | |
115 | LL | 0 + if b { 1 } else { 2 }; | |
923072b8 | 116 | | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider reducing it to: `(if b { 1 } else { 2 })` |
04454e1e | 117 | |
923072b8 | 118 | error: this operation has no effect |
c620b35d | 119 | --> tests/ui/identity_op.rs:109:5 |
923072b8 FG |
120 | | |
121 | LL | 0 + if b { 1 } else { 2 } + if b { 3 } else { 4 }; | |
122 | | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider reducing it to: `(if b { 1 } else { 2 })` | |
123 | ||
124 | error: this operation has no effect | |
c620b35d | 125 | --> tests/ui/identity_op.rs:111:5 |
04454e1e FG |
126 | | |
127 | LL | 0 + match a { 0 => 10, _ => 20 }; | |
923072b8 | 128 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider reducing it to: `(match a { 0 => 10, _ => 20 })` |
04454e1e | 129 | |
923072b8 | 130 | error: this operation has no effect |
c620b35d | 131 | --> tests/ui/identity_op.rs:113:5 |
04454e1e | 132 | | |
923072b8 FG |
133 | LL | 0 + match a { 0 => 10, _ => 20 } + match a { 0 => 30, _ => 40 }; |
134 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider reducing it to: `(match a { 0 => 10, _ => 20 })` | |
04454e1e | 135 | |
923072b8 | 136 | error: this operation has no effect |
c620b35d | 137 | --> tests/ui/identity_op.rs:115:5 |
04454e1e | 138 | | |
923072b8 FG |
139 | LL | 0 + if b { 1 } else { 2 } + match a { 0 => 30, _ => 40 }; |
140 | | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider reducing it to: `(if b { 1 } else { 2 })` | |
04454e1e | 141 | |
923072b8 | 142 | error: this operation has no effect |
c620b35d | 143 | --> tests/ui/identity_op.rs:117:5 |
923072b8 FG |
144 | | |
145 | LL | 0 + match a { 0 => 10, _ => 20 } + if b { 3 } else { 4 }; | |
146 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider reducing it to: `(match a { 0 => 10, _ => 20 })` | |
147 | ||
148 | error: this operation has no effect | |
c620b35d | 149 | --> tests/ui/identity_op.rs:119:5 |
923072b8 FG |
150 | | |
151 | LL | (if b { 1 } else { 2 }) + 0; | |
152 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider reducing it to: `(if b { 1 } else { 2 })` | |
153 | ||
154 | error: this operation has no effect | |
c620b35d | 155 | --> tests/ui/identity_op.rs:122:5 |
04454e1e | 156 | | |
923072b8 FG |
157 | LL | 0 + { a } + 3; |
158 | | ^^^^^^^^^ help: consider reducing it to: `({ a })` | |
04454e1e | 159 | |
923072b8 | 160 | error: this operation has no effect |
c620b35d | 161 | --> tests/ui/identity_op.rs:124:5 |
04454e1e | 162 | | |
923072b8 FG |
163 | LL | 0 + { a } * 2; |
164 | | ^^^^^^^^^^^^^ help: consider reducing it to: `({ a } * 2)` | |
04454e1e | 165 | |
923072b8 | 166 | error: this operation has no effect |
c620b35d | 167 | --> tests/ui/identity_op.rs:126:5 |
04454e1e | 168 | | |
923072b8 FG |
169 | LL | 0 + loop { let mut c = 0; if c == 10 { break c; } c += 1; } + { a * 2 }; |
170 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider reducing it to: `(loop { let mut c = 0; if c == 10 { break c; } c += 1; })` | |
04454e1e | 171 | |
923072b8 | 172 | error: this operation has no effect |
c620b35d | 173 | --> tests/ui/identity_op.rs:133:7 |
04454e1e | 174 | | |
923072b8 FG |
175 | LL | f(1 * a + { 8 * 5 }); |
176 | | ^^^^^ help: consider reducing it to: `a` | |
04454e1e | 177 | |
923072b8 | 178 | error: this operation has no effect |
c620b35d | 179 | --> tests/ui/identity_op.rs:135:7 |
04454e1e | 180 | | |
923072b8 FG |
181 | LL | f(0 + if b { 1 } else { 2 } + 3); |
182 | | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider reducing it to: `if b { 1 } else { 2 }` | |
04454e1e | 183 | |
923072b8 | 184 | error: this operation has no effect |
c620b35d | 185 | --> tests/ui/identity_op.rs:138:20 |
04454e1e | 186 | | |
923072b8 FG |
187 | LL | const _: i32 = { 2 * 4 } + 0 + 3; |
188 | | ^^^^^^^^^^^^^ help: consider reducing it to: `{ 2 * 4 }` | |
04454e1e | 189 | |
923072b8 | 190 | error: this operation has no effect |
c620b35d | 191 | --> tests/ui/identity_op.rs:140:20 |
04454e1e | 192 | | |
923072b8 FG |
193 | LL | const _: i32 = 0 + { 1 + 2 * 3 } + 3; |
194 | | ^^^^^^^^^^^^^^^^^ help: consider reducing it to: `{ 1 + 2 * 3 }` | |
04454e1e | 195 | |
923072b8 | 196 | error: this operation has no effect |
c620b35d | 197 | --> tests/ui/identity_op.rs:143:5 |
04454e1e | 198 | | |
923072b8 FG |
199 | LL | 0 + a as usize; |
200 | | ^^^^^^^^^^^^^^ help: consider reducing it to: `a as usize` | |
04454e1e | 201 | |
923072b8 | 202 | error: this operation has no effect |
c620b35d | 203 | --> tests/ui/identity_op.rs:145:13 |
04454e1e | 204 | | |
923072b8 FG |
205 | LL | let _ = 0 + a as usize; |
206 | | ^^^^^^^^^^^^^^ help: consider reducing it to: `a as usize` | |
04454e1e | 207 | |
923072b8 | 208 | error: this operation has no effect |
c620b35d | 209 | --> tests/ui/identity_op.rs:147:5 |
04454e1e | 210 | | |
923072b8 FG |
211 | LL | 0 + { a } as usize; |
212 | | ^^^^^^^^^^^^^^^^^^ help: consider reducing it to: `({ a } as usize)` | |
04454e1e | 213 | |
923072b8 | 214 | error: this operation has no effect |
c620b35d | 215 | --> tests/ui/identity_op.rs:150:9 |
04454e1e | 216 | | |
923072b8 FG |
217 | LL | 2 * (0 + { a }); |
218 | | ^^^^^^^^^^^ help: consider reducing it to: `{ a }` | |
219 | ||
220 | error: this operation has no effect | |
c620b35d | 221 | --> tests/ui/identity_op.rs:152:5 |
923072b8 FG |
222 | | |
223 | LL | 1 * ({ a } + 4); | |
224 | | ^^^^^^^^^^^^^^^ help: consider reducing it to: `(({ a } + 4))` | |
225 | ||
226 | error: this operation has no effect | |
c620b35d | 227 | --> tests/ui/identity_op.rs:154:5 |
923072b8 FG |
228 | | |
229 | LL | 1 * 1; | |
230 | | ^^^^^ help: consider reducing it to: `1` | |
231 | ||
232 | error: this operation has no effect | |
c620b35d | 233 | --> tests/ui/identity_op.rs:159:18 |
9c376795 FG |
234 | | |
235 | LL | let _: i32 = &x + 0; | |
236 | | ^^^^^^ help: consider reducing it to: `x` | |
237 | ||
238 | error: this operation has no effect | |
c620b35d | 239 | --> tests/ui/identity_op.rs:164:5 |
923072b8 FG |
240 | | |
241 | LL | 0 + if a { 1 } else { 2 } + if b { 3 } else { 5 } | |
242 | | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider reducing it to: `(if a { 1 } else { 2 })` | |
04454e1e | 243 | |
c0240ec0 | 244 | error: this operation has no effect |
c620b35d | 245 | --> tests/ui/identity_op.rs:175:22 |
c0240ec0 FG |
246 | | |
247 | LL | let _: i32 = *x + 0; | |
248 | | ^^^^^^ help: consider reducing it to: `*x` | |
249 | ||
250 | error: this operation has no effect | |
c620b35d | 251 | --> tests/ui/identity_op.rs:177:22 |
c0240ec0 FG |
252 | | |
253 | LL | let _: i32 = x + 0; | |
254 | | ^^^^^ help: consider reducing it to: `*x` | |
255 | ||
256 | error: this operation has no effect | |
c620b35d | 257 | --> tests/ui/identity_op.rs:182:22 |
c0240ec0 FG |
258 | | |
259 | LL | let _: i32 = **x + 0; | |
260 | | ^^^^^^^ help: consider reducing it to: `**x` | |
261 | ||
262 | error: this operation has no effect | |
c620b35d | 263 | --> tests/ui/identity_op.rs:185:22 |
c0240ec0 FG |
264 | | |
265 | LL | let _: i32 = *x + 0; | |
266 | | ^^^^^^ help: consider reducing it to: `**x` | |
267 | ||
268 | error: this operation has no effect | |
c620b35d | 269 | --> tests/ui/identity_op.rs:191:22 |
c0240ec0 FG |
270 | | |
271 | LL | let _: i32 = ***x + 0; | |
272 | | ^^^^^^^^ help: consider reducing it to: `***x` | |
273 | ||
274 | error: this operation has no effect | |
c620b35d | 275 | --> tests/ui/identity_op.rs:193:22 |
c0240ec0 FG |
276 | | |
277 | LL | let _: i32 = **x + 0; | |
278 | | ^^^^^^^ help: consider reducing it to: `***x` | |
279 | ||
280 | error: this operation has no effect | |
c620b35d | 281 | --> tests/ui/identity_op.rs:196:22 |
c0240ec0 FG |
282 | | |
283 | LL | let _: i32 = *&x + 0; | |
284 | | ^^^^^^^ help: consider reducing it to: `*&x` | |
285 | ||
286 | error: this operation has no effect | |
c620b35d | 287 | --> tests/ui/identity_op.rs:198:22 |
c0240ec0 FG |
288 | | |
289 | LL | let _: i32 = **&&x + 0; | |
290 | | ^^^^^^^^^ help: consider reducing it to: `**&&x` | |
291 | ||
292 | error: this operation has no effect | |
c620b35d | 293 | --> tests/ui/identity_op.rs:200:22 |
c0240ec0 FG |
294 | | |
295 | LL | let _: i32 = *&*&x + 0; | |
296 | | ^^^^^^^^^ help: consider reducing it to: `*&*&x` | |
297 | ||
298 | error: this operation has no effect | |
c620b35d | 299 | --> tests/ui/identity_op.rs:202:22 |
c0240ec0 FG |
300 | | |
301 | LL | let _: i32 = **&&*&x + 0; | |
302 | | ^^^^^^^^^^^ help: consider reducing it to: `**&&*&x` | |
303 | ||
304 | error: this operation has no effect | |
c620b35d | 305 | --> tests/ui/identity_op.rs:209:22 |
c0240ec0 FG |
306 | | |
307 | LL | let _: i32 = **&&*&x + 0; | |
308 | | ^^^^^^^^^^^ help: consider reducing it to: `***&&*&x` | |
309 | ||
310 | error: this operation has no effect | |
c620b35d | 311 | --> tests/ui/identity_op.rs:211:22 |
c0240ec0 FG |
312 | | |
313 | LL | let _: i32 = **&&*&x + 0; | |
314 | | ^^^^^^^^^^^ help: consider reducing it to: `***&&*&x` | |
315 | ||
316 | error: aborting due to 52 previous errors | |
f20569fa | 317 |