]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/identity_op.stderr
Rollup merge of #97709 - compiler-errors:normalize-const-param-ty, r=oli-obk
[rust.git] / src / tools / clippy / tests / ui / identity_op.stderr
1 error: this operation has no effect
2   --> $DIR/identity_op.rs:43: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
9 error: this operation has no effect
10   --> $DIR/identity_op.rs:44:5
11    |
12 LL |     x + (1 - 1);
13    |     ^^^^^^^^^^^ help: consider reducing it to: `x`
14
15 error: this operation has no effect
16   --> $DIR/identity_op.rs:46:5
17    |
18 LL |     0 + x;
19    |     ^^^^^ help: consider reducing it to: `x`
20
21 error: this operation has no effect
22   --> $DIR/identity_op.rs:49:5
23    |
24 LL |     x | (0);
25    |     ^^^^^^^ help: consider reducing it to: `x`
26
27 error: this operation has no effect
28   --> $DIR/identity_op.rs:52:5
29    |
30 LL |     x * 1;
31    |     ^^^^^ help: consider reducing it to: `x`
32
33 error: this operation has no effect
34   --> $DIR/identity_op.rs:53:5
35    |
36 LL |     1 * x;
37    |     ^^^^^ help: consider reducing it to: `x`
38
39 error: this operation has no effect
40   --> $DIR/identity_op.rs:59:5
41    |
42 LL |     -1 & x;
43    |     ^^^^^^ help: consider reducing it to: `x`
44
45 error: this operation has no effect
46   --> $DIR/identity_op.rs:62:5
47    |
48 LL |     u & 255;
49    |     ^^^^^^^ help: consider reducing it to: `u`
50
51 error: this operation has no effect
52   --> $DIR/identity_op.rs:65:5
53    |
54 LL |     42 << 0;
55    |     ^^^^^^^ help: consider reducing it to: `42`
56
57 error: this operation has no effect
58   --> $DIR/identity_op.rs:66:5
59    |
60 LL |     1 >> 0;
61    |     ^^^^^^ help: consider reducing it to: `1`
62
63 error: this operation has no effect
64   --> $DIR/identity_op.rs:67:5
65    |
66 LL |     42 >> 0;
67    |     ^^^^^^^ help: consider reducing it to: `42`
68
69 error: this operation has no effect
70   --> $DIR/identity_op.rs:68:5
71    |
72 LL |     &x >> 0;
73    |     ^^^^^^^ help: consider reducing it to: `&x`
74
75 error: this operation has no effect
76   --> $DIR/identity_op.rs:69:5
77    |
78 LL |     x >> &0;
79    |     ^^^^^^^ help: consider reducing it to: `x`
80
81 error: this operation has no effect
82   --> $DIR/identity_op.rs:76:5
83    |
84 LL |     2 % 3;
85    |     ^^^^^ help: consider reducing it to: `2`
86
87 error: this operation has no effect
88   --> $DIR/identity_op.rs:77:5
89    |
90 LL |     -2 % 3;
91    |     ^^^^^^ help: consider reducing it to: `-2`
92
93 error: this operation has no effect
94   --> $DIR/identity_op.rs:78:5
95    |
96 LL |     2 % -3 + x;
97    |     ^^^^^^ help: consider reducing it to: `2`
98
99 error: this operation has no effect
100   --> $DIR/identity_op.rs:79:5
101    |
102 LL |     -2 % -3 + x;
103    |     ^^^^^^^ help: consider reducing it to: `-2`
104
105 error: this operation has no effect
106   --> $DIR/identity_op.rs:80:9
107    |
108 LL |     x + 1 % 3;
109    |         ^^^^^ help: consider reducing it to: `1`
110
111 error: this operation has no effect
112   --> $DIR/identity_op.rs:88:5
113    |
114 LL |     0 + if b { 1 } else { 2 };
115    |     ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider reducing it to: `(if b { 1 } else { 2 })`
116
117 error: this operation has no effect
118   --> $DIR/identity_op.rs:89:5
119    |
120 LL |     0 + if b { 1 } else { 2 } + if b { 3 } else { 4 };
121    |     ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider reducing it to: `(if b { 1 } else { 2 })`
122
123 error: this operation has no effect
124   --> $DIR/identity_op.rs:90:5
125    |
126 LL |     0 + match a { 0 => 10, _ => 20 };
127    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider reducing it to: `(match a { 0 => 10, _ => 20 })`
128
129 error: this operation has no effect
130   --> $DIR/identity_op.rs:91:5
131    |
132 LL |     0 + match a { 0 => 10, _ => 20 } + match a { 0 => 30, _ => 40 };
133    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider reducing it to: `(match a { 0 => 10, _ => 20 })`
134
135 error: this operation has no effect
136   --> $DIR/identity_op.rs:92:5
137    |
138 LL |     0 + if b { 1 } else { 2 } + match a { 0 => 30, _ => 40 };
139    |     ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider reducing it to: `(if b { 1 } else { 2 })`
140
141 error: this operation has no effect
142   --> $DIR/identity_op.rs:93:5
143    |
144 LL |     0 + match a { 0 => 10, _ => 20 } + if b { 3 } else { 4 };
145    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider reducing it to: `(match a { 0 => 10, _ => 20 })`
146
147 error: this operation has no effect
148   --> $DIR/identity_op.rs:94:5
149    |
150 LL |     (if b { 1 } else { 2 }) + 0;
151    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider reducing it to: `(if b { 1 } else { 2 })`
152
153 error: this operation has no effect
154   --> $DIR/identity_op.rs:96:5
155    |
156 LL |     0 + { a } + 3;
157    |     ^^^^^^^^^ help: consider reducing it to: `({ a })`
158
159 error: this operation has no effect
160   --> $DIR/identity_op.rs:97:5
161    |
162 LL |     0 + { a } * 2;
163    |     ^^^^^^^^^^^^^ help: consider reducing it to: `({ a } * 2)`
164
165 error: this operation has no effect
166   --> $DIR/identity_op.rs:98:5
167    |
168 LL |     0 + loop { let mut c = 0; if c == 10 { break c; } c += 1; } + { a * 2 };
169    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider reducing it to: `(loop { let mut c = 0; if c == 10 { break c; } c += 1; })`
170
171 error: this operation has no effect
172   --> $DIR/identity_op.rs:103:7
173    |
174 LL |     f(1 * a + { 8 * 5 });
175    |       ^^^^^ help: consider reducing it to: `a`
176
177 error: this operation has no effect
178   --> $DIR/identity_op.rs:104:7
179    |
180 LL |     f(0 + if b { 1 } else { 2 } + 3);
181    |       ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider reducing it to: `if b { 1 } else { 2 }`
182
183 error: this operation has no effect
184   --> $DIR/identity_op.rs:105:20
185    |
186 LL |     const _: i32 = { 2 * 4 } + 0 + 3;
187    |                    ^^^^^^^^^^^^^ help: consider reducing it to: `{ 2 * 4 }`
188
189 error: this operation has no effect
190   --> $DIR/identity_op.rs:106:20
191    |
192 LL |     const _: i32 = 0 + { 1 + 2 * 3 } + 3;
193    |                    ^^^^^^^^^^^^^^^^^ help: consider reducing it to: `{ 1 + 2 * 3 }`
194
195 error: this operation has no effect
196   --> $DIR/identity_op.rs:108:5
197    |
198 LL |     0 + a as usize;
199    |     ^^^^^^^^^^^^^^ help: consider reducing it to: `a as usize`
200
201 error: this operation has no effect
202   --> $DIR/identity_op.rs:109:13
203    |
204 LL |     let _ = 0 + a as usize;
205    |             ^^^^^^^^^^^^^^ help: consider reducing it to: `a as usize`
206
207 error: this operation has no effect
208   --> $DIR/identity_op.rs:110:5
209    |
210 LL |     0 + { a } as usize;
211    |     ^^^^^^^^^^^^^^^^^^ help: consider reducing it to: `({ a } as usize)`
212
213 error: this operation has no effect
214   --> $DIR/identity_op.rs:112:9
215    |
216 LL |     2 * (0 + { a });
217    |         ^^^^^^^^^^^ help: consider reducing it to: `{ a }`
218
219 error: this operation has no effect
220   --> $DIR/identity_op.rs:113:5
221    |
222 LL |     1 * ({ a } + 4);
223    |     ^^^^^^^^^^^^^^^ help: consider reducing it to: `(({ a } + 4))`
224
225 error: this operation has no effect
226   --> $DIR/identity_op.rs:114:5
227    |
228 LL |     1 * 1;
229    |     ^^^^^ help: consider reducing it to: `1`
230
231 error: this operation has no effect
232   --> $DIR/identity_op.rs:118:5
233    |
234 LL |     0 + if a { 1 } else { 2 } + if b { 3 } else { 5 }
235    |     ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider reducing it to: `(if a { 1 } else { 2 })`
236
237 error: aborting due to 39 previous errors
238