]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/manual_clamp.stderr
Auto merge of #99292 - Aaron1011:stability-use-tree, r=cjgillot
[rust.git] / src / tools / clippy / tests / ui / manual_clamp.stderr
1 error: clamp-like pattern without using clamp function
2   --> $DIR/manual_clamp.rs:76:5
3    |
4 LL | /     if x9 < min {
5 LL | |         x9 = min;
6 LL | |     }
7 LL | |     if x9 > max {
8 LL | |         x9 = max;
9 LL | |     }
10    | |_____^ help: replace with clamp: `x9 = x9.clamp(min, max);`
11    |
12    = note: clamp will panic if max < min
13    = note: `-D clippy::manual-clamp` implied by `-D warnings`
14
15 error: clamp-like pattern without using clamp function
16   --> $DIR/manual_clamp.rs:91:5
17    |
18 LL | /     if x11 > max {
19 LL | |         x11 = max;
20 LL | |     }
21 LL | |     if x11 < min {
22 LL | |         x11 = min;
23 LL | |     }
24    | |_____^ help: replace with clamp: `x11 = x11.clamp(min, max);`
25    |
26    = note: clamp will panic if max < min
27
28 error: clamp-like pattern without using clamp function
29   --> $DIR/manual_clamp.rs:99:5
30    |
31 LL | /     if min > x12 {
32 LL | |         x12 = min;
33 LL | |     }
34 LL | |     if max < x12 {
35 LL | |         x12 = max;
36 LL | |     }
37    | |_____^ help: replace with clamp: `x12 = x12.clamp(min, max);`
38    |
39    = note: clamp will panic if max < min
40
41 error: clamp-like pattern without using clamp function
42   --> $DIR/manual_clamp.rs:107:5
43    |
44 LL | /     if max < x13 {
45 LL | |         x13 = max;
46 LL | |     }
47 LL | |     if min > x13 {
48 LL | |         x13 = min;
49 LL | |     }
50    | |_____^ help: replace with clamp: `x13 = x13.clamp(min, max);`
51    |
52    = note: clamp will panic if max < min
53
54 error: clamp-like pattern without using clamp function
55   --> $DIR/manual_clamp.rs:161:5
56    |
57 LL | /     if max < x33 {
58 LL | |         x33 = max;
59 LL | |     }
60 LL | |     if min > x33 {
61 LL | |         x33 = min;
62 LL | |     }
63    | |_____^ help: replace with clamp: `x33 = x33.clamp(min, max);`
64    |
65    = note: clamp will panic if max < min
66
67 error: clamp-like pattern without using clamp function
68   --> $DIR/manual_clamp.rs:21:14
69    |
70 LL |       let x0 = if max < input {
71    |  ______________^
72 LL | |         max
73 LL | |     } else if min > input {
74 LL | |         min
75 LL | |     } else {
76 LL | |         input
77 LL | |     };
78    | |_____^ help: replace with clamp: `input.clamp(min, max)`
79    |
80    = note: clamp will panic if max < min
81
82 error: clamp-like pattern without using clamp function
83   --> $DIR/manual_clamp.rs:29:14
84    |
85 LL |       let x1 = if input > max {
86    |  ______________^
87 LL | |         max
88 LL | |     } else if input < min {
89 LL | |         min
90 LL | |     } else {
91 LL | |         input
92 LL | |     };
93    | |_____^ help: replace with clamp: `input.clamp(min, max)`
94    |
95    = note: clamp will panic if max < min
96
97 error: clamp-like pattern without using clamp function
98   --> $DIR/manual_clamp.rs:37:14
99    |
100 LL |       let x2 = if input < min {
101    |  ______________^
102 LL | |         min
103 LL | |     } else if input > max {
104 LL | |         max
105 LL | |     } else {
106 LL | |         input
107 LL | |     };
108    | |_____^ help: replace with clamp: `input.clamp(min, max)`
109    |
110    = note: clamp will panic if max < min
111
112 error: clamp-like pattern without using clamp function
113   --> $DIR/manual_clamp.rs:45:14
114    |
115 LL |       let x3 = if min > input {
116    |  ______________^
117 LL | |         min
118 LL | |     } else if max < input {
119 LL | |         max
120 LL | |     } else {
121 LL | |         input
122 LL | |     };
123    | |_____^ help: replace with clamp: `input.clamp(min, max)`
124    |
125    = note: clamp will panic if max < min
126
127 error: clamp-like pattern without using clamp function
128   --> $DIR/manual_clamp.rs:53:14
129    |
130 LL |     let x4 = input.max(min).min(max);
131    |              ^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(min, max)`
132    |
133    = note: clamp will panic if max < min
134
135 error: clamp-like pattern without using clamp function
136   --> $DIR/manual_clamp.rs:55:14
137    |
138 LL |     let x5 = input.min(max).max(min);
139    |              ^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(min, max)`
140    |
141    = note: clamp will panic if max < min
142
143 error: clamp-like pattern without using clamp function
144   --> $DIR/manual_clamp.rs:57:14
145    |
146 LL |       let x6 = match input {
147    |  ______________^
148 LL | |         x if x > max => max,
149 LL | |         x if x < min => min,
150 LL | |         x => x,
151 LL | |     };
152    | |_____^ help: replace with clamp: `input.clamp(min, max)`
153    |
154    = note: clamp will panic if max < min
155
156 error: clamp-like pattern without using clamp function
157   --> $DIR/manual_clamp.rs:63:14
158    |
159 LL |       let x7 = match input {
160    |  ______________^
161 LL | |         x if x < min => min,
162 LL | |         x if x > max => max,
163 LL | |         x => x,
164 LL | |     };
165    | |_____^ help: replace with clamp: `input.clamp(min, max)`
166    |
167    = note: clamp will panic if max < min
168
169 error: clamp-like pattern without using clamp function
170   --> $DIR/manual_clamp.rs:69:14
171    |
172 LL |       let x8 = match input {
173    |  ______________^
174 LL | |         x if max < x => max,
175 LL | |         x if min > x => min,
176 LL | |         x => x,
177 LL | |     };
178    | |_____^ help: replace with clamp: `input.clamp(min, max)`
179    |
180    = note: clamp will panic if max < min
181
182 error: clamp-like pattern without using clamp function
183   --> $DIR/manual_clamp.rs:83:15
184    |
185 LL |       let x10 = match input {
186    |  _______________^
187 LL | |         x if min > x => min,
188 LL | |         x if max < x => max,
189 LL | |         x => x,
190 LL | |     };
191    | |_____^ help: replace with clamp: `input.clamp(min, max)`
192    |
193    = note: clamp will panic if max < min
194
195 error: clamp-like pattern without using clamp function
196   --> $DIR/manual_clamp.rs:114:15
197    |
198 LL |       let x14 = if input > CONST_MAX {
199    |  _______________^
200 LL | |         CONST_MAX
201 LL | |     } else if input < CONST_MIN {
202 LL | |         CONST_MIN
203 LL | |     } else {
204 LL | |         input
205 LL | |     };
206    | |_____^ help: replace with clamp: `input.clamp(CONST_MIN, CONST_MAX)`
207    |
208    = note: clamp will panic if max < min
209
210 error: clamp-like pattern without using clamp function
211   --> $DIR/manual_clamp.rs:123:19
212    |
213 LL |           let x15 = if input > max {
214    |  ___________________^
215 LL | |             max
216 LL | |         } else if input < min {
217 LL | |             min
218 LL | |         } else {
219 LL | |             input
220 LL | |         };
221    | |_________^ help: replace with clamp: `input.clamp(min, max)`
222    |
223    = note: clamp will panic if max < min, min.is_nan(), or max.is_nan()
224    = note: clamp returns NaN if the input is NaN
225
226 error: clamp-like pattern without using clamp function
227   --> $DIR/manual_clamp.rs:134:19
228    |
229 LL |         let x16 = cmp_max(cmp_min(input, CONST_MAX), CONST_MIN);
230    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_MIN, CONST_MAX)`
231    |
232    = note: clamp will panic if max < min
233
234 error: clamp-like pattern without using clamp function
235   --> $DIR/manual_clamp.rs:135:19
236    |
237 LL |         let x17 = cmp_min(cmp_max(input, CONST_MIN), CONST_MAX);
238    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_MIN, CONST_MAX)`
239    |
240    = note: clamp will panic if max < min
241
242 error: clamp-like pattern without using clamp function
243   --> $DIR/manual_clamp.rs:136:19
244    |
245 LL |         let x18 = cmp_max(CONST_MIN, cmp_min(input, CONST_MAX));
246    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_MIN, CONST_MAX)`
247    |
248    = note: clamp will panic if max < min
249
250 error: clamp-like pattern without using clamp function
251   --> $DIR/manual_clamp.rs:137:19
252    |
253 LL |         let x19 = cmp_min(CONST_MAX, cmp_max(input, CONST_MIN));
254    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_MIN, CONST_MAX)`
255    |
256    = note: clamp will panic if max < min
257
258 error: clamp-like pattern without using clamp function
259   --> $DIR/manual_clamp.rs:138:19
260    |
261 LL |         let x20 = cmp_max(cmp_min(CONST_MAX, input), CONST_MIN);
262    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_MIN, CONST_MAX)`
263    |
264    = note: clamp will panic if max < min
265
266 error: clamp-like pattern without using clamp function
267   --> $DIR/manual_clamp.rs:139:19
268    |
269 LL |         let x21 = cmp_min(cmp_max(CONST_MIN, input), CONST_MAX);
270    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_MIN, CONST_MAX)`
271    |
272    = note: clamp will panic if max < min
273
274 error: clamp-like pattern without using clamp function
275   --> $DIR/manual_clamp.rs:140:19
276    |
277 LL |         let x22 = cmp_max(CONST_MIN, cmp_min(CONST_MAX, input));
278    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_MIN, CONST_MAX)`
279    |
280    = note: clamp will panic if max < min
281
282 error: clamp-like pattern without using clamp function
283   --> $DIR/manual_clamp.rs:141:19
284    |
285 LL |         let x23 = cmp_min(CONST_MAX, cmp_max(CONST_MIN, input));
286    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_MIN, CONST_MAX)`
287    |
288    = note: clamp will panic if max < min
289
290 error: clamp-like pattern without using clamp function
291   --> $DIR/manual_clamp.rs:143:19
292    |
293 LL |         let x24 = f64::max(f64::min(input, CONST_F64_MAX), CONST_F64_MIN);
294    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_F64_MIN, CONST_F64_MAX)`
295    |
296    = note: clamp will panic if max < min, min.is_nan(), or max.is_nan()
297    = note: clamp returns NaN if the input is NaN
298
299 error: clamp-like pattern without using clamp function
300   --> $DIR/manual_clamp.rs:144:19
301    |
302 LL |         let x25 = f64::min(f64::max(input, CONST_F64_MIN), CONST_F64_MAX);
303    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_F64_MIN, CONST_F64_MAX)`
304    |
305    = note: clamp will panic if max < min, min.is_nan(), or max.is_nan()
306    = note: clamp returns NaN if the input is NaN
307
308 error: clamp-like pattern without using clamp function
309   --> $DIR/manual_clamp.rs:145:19
310    |
311 LL |         let x26 = f64::max(CONST_F64_MIN, f64::min(input, CONST_F64_MAX));
312    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_F64_MIN, CONST_F64_MAX)`
313    |
314    = note: clamp will panic if max < min, min.is_nan(), or max.is_nan()
315    = note: clamp returns NaN if the input is NaN
316
317 error: clamp-like pattern without using clamp function
318   --> $DIR/manual_clamp.rs:146:19
319    |
320 LL |         let x27 = f64::min(CONST_F64_MAX, f64::max(input, CONST_F64_MIN));
321    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_F64_MIN, CONST_F64_MAX)`
322    |
323    = note: clamp will panic if max < min, min.is_nan(), or max.is_nan()
324    = note: clamp returns NaN if the input is NaN
325
326 error: clamp-like pattern without using clamp function
327   --> $DIR/manual_clamp.rs:147:19
328    |
329 LL |         let x28 = f64::max(f64::min(CONST_F64_MAX, input), CONST_F64_MIN);
330    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_F64_MIN, CONST_F64_MAX)`
331    |
332    = note: clamp will panic if max < min, min.is_nan(), or max.is_nan()
333    = note: clamp returns NaN if the input is NaN
334
335 error: clamp-like pattern without using clamp function
336   --> $DIR/manual_clamp.rs:148:19
337    |
338 LL |         let x29 = f64::min(f64::max(CONST_F64_MIN, input), CONST_F64_MAX);
339    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_F64_MIN, CONST_F64_MAX)`
340    |
341    = note: clamp will panic if max < min, min.is_nan(), or max.is_nan()
342    = note: clamp returns NaN if the input is NaN
343
344 error: clamp-like pattern without using clamp function
345   --> $DIR/manual_clamp.rs:149:19
346    |
347 LL |         let x30 = f64::max(CONST_F64_MIN, f64::min(CONST_F64_MAX, input));
348    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_F64_MIN, CONST_F64_MAX)`
349    |
350    = note: clamp will panic if max < min, min.is_nan(), or max.is_nan()
351    = note: clamp returns NaN if the input is NaN
352
353 error: clamp-like pattern without using clamp function
354   --> $DIR/manual_clamp.rs:150:19
355    |
356 LL |         let x31 = f64::min(CONST_F64_MAX, f64::max(CONST_F64_MIN, input));
357    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_F64_MIN, CONST_F64_MAX)`
358    |
359    = note: clamp will panic if max < min, min.is_nan(), or max.is_nan()
360    = note: clamp returns NaN if the input is NaN
361
362 error: clamp-like pattern without using clamp function
363   --> $DIR/manual_clamp.rs:153:5
364    |
365 LL | /     if x32 < min {
366 LL | |         x32 = min;
367 LL | |     } else if x32 > max {
368 LL | |         x32 = max;
369 LL | |     }
370    | |_____^ help: replace with clamp: `x32 = x32.clamp(min, max);`
371    |
372    = note: clamp will panic if max < min
373
374 error: aborting due to 34 previous errors
375