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