fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

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