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