]> git.lizzy.rs Git - rust.git/blob - src/test/ui/numeric/numeric-cast.stderr
Suggest try_into when possible
[rust.git] / src / test / ui / numeric / numeric-cast.stderr
1 error[E0308]: mismatched types
2   --> $DIR/numeric-cast.rs:23:18
3    |
4 LL |     foo::<usize>(x_u64);
5    |                  ^^^^^ expected usize, found u64
6 help: you can convert an `u64` to `usize` or panic if it the converted value wouldn't fit
7    |
8 LL |     foo::<usize>(x_u64.try_into().unwrap());
9    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^
10
11 error[E0308]: mismatched types
12   --> $DIR/numeric-cast.rs:25:18
13    |
14 LL |     foo::<usize>(x_u32);
15    |                  ^^^^^ expected usize, found u32
16 help: you can convert an `u32` to `usize` or panic if it the converted value wouldn't fit
17    |
18 LL |     foo::<usize>(x_u32.try_into().unwrap());
19    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^
20
21 error[E0308]: mismatched types
22   --> $DIR/numeric-cast.rs:27:18
23    |
24 LL |     foo::<usize>(x_u16);
25    |                  ^^^^^ expected usize, found u16
26 help: you can convert an `u16` to `usize` or panic if it the converted value wouldn't fit
27    |
28 LL |     foo::<usize>(x_u16.try_into().unwrap());
29    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^
30
31 error[E0308]: mismatched types
32   --> $DIR/numeric-cast.rs:29:18
33    |
34 LL |     foo::<usize>(x_u8);
35    |                  ^^^^ expected usize, found u8
36 help: you can convert an `u8` to `usize` or panic if it the converted value wouldn't fit
37    |
38 LL |     foo::<usize>(x_u8.try_into().unwrap());
39    |                  ^^^^^^^^^^^^^^^^^^^^^^^^
40
41 error[E0308]: mismatched types
42   --> $DIR/numeric-cast.rs:31:18
43    |
44 LL |     foo::<usize>(x_isize);
45    |                  ^^^^^^^ expected usize, found isize
46 help: you can convert an `isize` to `usize` or panic if it the converted value wouldn't fit
47    |
48 LL |     foo::<usize>(x_isize.try_into().unwrap());
49    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^
50
51 error[E0308]: mismatched types
52   --> $DIR/numeric-cast.rs:33:18
53    |
54 LL |     foo::<usize>(x_i64);
55    |                  ^^^^^ expected usize, found i64
56 help: you can convert an `i64` to `usize` or panic if it the converted value wouldn't fit
57    |
58 LL |     foo::<usize>(x_i64.try_into().unwrap());
59    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^
60
61 error[E0308]: mismatched types
62   --> $DIR/numeric-cast.rs:35:18
63    |
64 LL |     foo::<usize>(x_i32);
65    |                  ^^^^^ expected usize, found i32
66 help: you can convert an `i32` to `usize` or panic if it the converted value wouldn't fit
67    |
68 LL |     foo::<usize>(x_i32.try_into().unwrap());
69    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^
70
71 error[E0308]: mismatched types
72   --> $DIR/numeric-cast.rs:37:18
73    |
74 LL |     foo::<usize>(x_i16);
75    |                  ^^^^^ expected usize, found i16
76 help: you can convert an `i16` to `usize` or panic if it the converted value wouldn't fit
77    |
78 LL |     foo::<usize>(x_i16.try_into().unwrap());
79    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^
80
81 error[E0308]: mismatched types
82   --> $DIR/numeric-cast.rs:39:18
83    |
84 LL |     foo::<usize>(x_i8);
85    |                  ^^^^ expected usize, found i8
86 help: you can convert an `i8` to `usize` or panic if it the converted value wouldn't fit
87    |
88 LL |     foo::<usize>(x_i8.try_into().unwrap());
89    |                  ^^^^^^^^^^^^^^^^^^^^^^^^
90
91 error[E0308]: mismatched types
92   --> $DIR/numeric-cast.rs:44:18
93    |
94 LL |     foo::<isize>(x_usize);
95    |                  ^^^^^^^ expected isize, found usize
96 help: you can convert an `usize` to `isize` or panic if it the converted value wouldn't fit
97    |
98 LL |     foo::<isize>(x_usize.try_into().unwrap());
99    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^
100
101 error[E0308]: mismatched types
102   --> $DIR/numeric-cast.rs:46:18
103    |
104 LL |     foo::<isize>(x_u64);
105    |                  ^^^^^ expected isize, found u64
106 help: you can convert an `u64` to `isize` or panic if it the converted value wouldn't fit
107    |
108 LL |     foo::<isize>(x_u64.try_into().unwrap());
109    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^
110
111 error[E0308]: mismatched types
112   --> $DIR/numeric-cast.rs:48:18
113    |
114 LL |     foo::<isize>(x_u32);
115    |                  ^^^^^ expected isize, found u32
116 help: you can convert an `u32` to `isize` or panic if it the converted value wouldn't fit
117    |
118 LL |     foo::<isize>(x_u32.try_into().unwrap());
119    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^
120
121 error[E0308]: mismatched types
122   --> $DIR/numeric-cast.rs:50:18
123    |
124 LL |     foo::<isize>(x_u16);
125    |                  ^^^^^ expected isize, found u16
126 help: you can convert an `u16` to `isize` or panic if it the converted value wouldn't fit
127    |
128 LL |     foo::<isize>(x_u16.try_into().unwrap());
129    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^
130
131 error[E0308]: mismatched types
132   --> $DIR/numeric-cast.rs:52:18
133    |
134 LL |     foo::<isize>(x_u8);
135    |                  ^^^^ expected isize, found u8
136 help: you can convert an `u8` to `isize` or panic if it the converted value wouldn't fit
137    |
138 LL |     foo::<isize>(x_u8.try_into().unwrap());
139    |                  ^^^^^^^^^^^^^^^^^^^^^^^^
140
141 error[E0308]: mismatched types
142   --> $DIR/numeric-cast.rs:55:18
143    |
144 LL |     foo::<isize>(x_i64);
145    |                  ^^^^^ expected isize, found i64
146 help: you can convert an `i64` to `isize` or panic if it the converted value wouldn't fit
147    |
148 LL |     foo::<isize>(x_i64.try_into().unwrap());
149    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^
150
151 error[E0308]: mismatched types
152   --> $DIR/numeric-cast.rs:57:18
153    |
154 LL |     foo::<isize>(x_i32);
155    |                  ^^^^^ expected isize, found i32
156 help: you can convert an `i32` to `isize` or panic if it the converted value wouldn't fit
157    |
158 LL |     foo::<isize>(x_i32.try_into().unwrap());
159    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^
160
161 error[E0308]: mismatched types
162   --> $DIR/numeric-cast.rs:59:18
163    |
164 LL |     foo::<isize>(x_i16);
165    |                  ^^^^^ expected isize, found i16
166 help: you can convert an `i16` to `isize` or panic if it the converted value wouldn't fit
167    |
168 LL |     foo::<isize>(x_i16.try_into().unwrap());
169    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^
170
171 error[E0308]: mismatched types
172   --> $DIR/numeric-cast.rs:61:18
173    |
174 LL |     foo::<isize>(x_i8);
175    |                  ^^^^ expected isize, found i8
176 help: you can convert an `i8` to `isize` or panic if it the converted value wouldn't fit
177    |
178 LL |     foo::<isize>(x_i8.try_into().unwrap());
179    |                  ^^^^^^^^^^^^^^^^^^^^^^^^
180
181 error[E0308]: mismatched types
182   --> $DIR/numeric-cast.rs:66:16
183    |
184 LL |     foo::<u64>(x_usize);
185    |                ^^^^^^^ expected u64, found usize
186 help: you can convert an `usize` to `u64` or panic if it the converted value wouldn't fit
187    |
188 LL |     foo::<u64>(x_usize.try_into().unwrap());
189    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
190
191 error[E0308]: mismatched types
192   --> $DIR/numeric-cast.rs:69:16
193    |
194 LL |     foo::<u64>(x_u32);
195    |                ^^^^^
196    |                |
197    |                expected u64, found u32
198    |                help: you can convert an `u32` to `u64`: `x_u32.into()`
199
200 error[E0308]: mismatched types
201   --> $DIR/numeric-cast.rs:71:16
202    |
203 LL |     foo::<u64>(x_u16);
204    |                ^^^^^
205    |                |
206    |                expected u64, found u16
207    |                help: you can convert an `u16` to `u64`: `x_u16.into()`
208
209 error[E0308]: mismatched types
210   --> $DIR/numeric-cast.rs:73:16
211    |
212 LL |     foo::<u64>(x_u8);
213    |                ^^^^
214    |                |
215    |                expected u64, found u8
216    |                help: you can convert an `u8` to `u64`: `x_u8.into()`
217
218 error[E0308]: mismatched types
219   --> $DIR/numeric-cast.rs:75:16
220    |
221 LL |     foo::<u64>(x_isize);
222    |                ^^^^^^^ expected u64, found isize
223 help: you can convert an `isize` to `u64` or panic if it the converted value wouldn't fit
224    |
225 LL |     foo::<u64>(x_isize.try_into().unwrap());
226    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
227
228 error[E0308]: mismatched types
229   --> $DIR/numeric-cast.rs:77:16
230    |
231 LL |     foo::<u64>(x_i64);
232    |                ^^^^^ expected u64, found i64
233 help: you can convert an `i64` to `u64` or panic if it the converted value wouldn't fit
234    |
235 LL |     foo::<u64>(x_i64.try_into().unwrap());
236    |                ^^^^^^^^^^^^^^^^^^^^^^^^^
237
238 error[E0308]: mismatched types
239   --> $DIR/numeric-cast.rs:79:16
240    |
241 LL |     foo::<u64>(x_i32);
242    |                ^^^^^ expected u64, found i32
243 help: you can convert an `i32` to `u64` or panic if it the converted value wouldn't fit
244    |
245 LL |     foo::<u64>(x_i32.try_into().unwrap());
246    |                ^^^^^^^^^^^^^^^^^^^^^^^^^
247
248 error[E0308]: mismatched types
249   --> $DIR/numeric-cast.rs:81:16
250    |
251 LL |     foo::<u64>(x_i16);
252    |                ^^^^^ expected u64, found i16
253 help: you can convert an `i16` to `u64` or panic if it the converted value wouldn't fit
254    |
255 LL |     foo::<u64>(x_i16.try_into().unwrap());
256    |                ^^^^^^^^^^^^^^^^^^^^^^^^^
257
258 error[E0308]: mismatched types
259   --> $DIR/numeric-cast.rs:83:16
260    |
261 LL |     foo::<u64>(x_i8);
262    |                ^^^^ expected u64, found i8
263 help: you can convert an `i8` to `u64` or panic if it the converted value wouldn't fit
264    |
265 LL |     foo::<u64>(x_i8.try_into().unwrap());
266    |                ^^^^^^^^^^^^^^^^^^^^^^^^
267
268 error[E0308]: mismatched types
269   --> $DIR/numeric-cast.rs:88:16
270    |
271 LL |     foo::<i64>(x_usize);
272    |                ^^^^^^^ expected i64, found usize
273 help: you can convert an `usize` to `i64` or panic if it the converted value wouldn't fit
274    |
275 LL |     foo::<i64>(x_usize.try_into().unwrap());
276    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
277
278 error[E0308]: mismatched types
279   --> $DIR/numeric-cast.rs:90:16
280    |
281 LL |     foo::<i64>(x_u64);
282    |                ^^^^^ expected i64, found u64
283 help: you can convert an `u64` to `i64` or panic if it the converted value wouldn't fit
284    |
285 LL |     foo::<i64>(x_u64.try_into().unwrap());
286    |                ^^^^^^^^^^^^^^^^^^^^^^^^^
287
288 error[E0308]: mismatched types
289   --> $DIR/numeric-cast.rs:92:16
290    |
291 LL |     foo::<i64>(x_u32);
292    |                ^^^^^ expected i64, found u32
293 help: you can convert an `u32` to `i64` or panic if it the converted value wouldn't fit
294    |
295 LL |     foo::<i64>(x_u32.try_into().unwrap());
296    |                ^^^^^^^^^^^^^^^^^^^^^^^^^
297
298 error[E0308]: mismatched types
299   --> $DIR/numeric-cast.rs:94:16
300    |
301 LL |     foo::<i64>(x_u16);
302    |                ^^^^^ expected i64, found u16
303 help: you can convert an `u16` to `i64` or panic if it the converted value wouldn't fit
304    |
305 LL |     foo::<i64>(x_u16.try_into().unwrap());
306    |                ^^^^^^^^^^^^^^^^^^^^^^^^^
307
308 error[E0308]: mismatched types
309   --> $DIR/numeric-cast.rs:96:16
310    |
311 LL |     foo::<i64>(x_u8);
312    |                ^^^^ expected i64, found u8
313 help: you can convert an `u8` to `i64` or panic if it the converted value wouldn't fit
314    |
315 LL |     foo::<i64>(x_u8.try_into().unwrap());
316    |                ^^^^^^^^^^^^^^^^^^^^^^^^
317
318 error[E0308]: mismatched types
319   --> $DIR/numeric-cast.rs:98:16
320    |
321 LL |     foo::<i64>(x_isize);
322    |                ^^^^^^^ expected i64, found isize
323 help: you can convert an `isize` to `i64` or panic if it the converted value wouldn't fit
324    |
325 LL |     foo::<i64>(x_isize.try_into().unwrap());
326    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
327
328 error[E0308]: mismatched types
329   --> $DIR/numeric-cast.rs:101:16
330    |
331 LL |     foo::<i64>(x_i32);
332    |                ^^^^^
333    |                |
334    |                expected i64, found i32
335    |                help: you can convert an `i32` to `i64`: `x_i32.into()`
336
337 error[E0308]: mismatched types
338   --> $DIR/numeric-cast.rs:103:16
339    |
340 LL |     foo::<i64>(x_i16);
341    |                ^^^^^
342    |                |
343    |                expected i64, found i16
344    |                help: you can convert an `i16` to `i64`: `x_i16.into()`
345
346 error[E0308]: mismatched types
347   --> $DIR/numeric-cast.rs:105:16
348    |
349 LL |     foo::<i64>(x_i8);
350    |                ^^^^
351    |                |
352    |                expected i64, found i8
353    |                help: you can convert an `i8` to `i64`: `x_i8.into()`
354
355 error[E0308]: mismatched types
356   --> $DIR/numeric-cast.rs:110:16
357    |
358 LL |     foo::<u32>(x_usize);
359    |                ^^^^^^^ expected u32, found usize
360 help: you can convert an `usize` to `u32` or panic if it the converted value wouldn't fit
361    |
362 LL |     foo::<u32>(x_usize.try_into().unwrap());
363    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
364
365 error[E0308]: mismatched types
366   --> $DIR/numeric-cast.rs:112:16
367    |
368 LL |     foo::<u32>(x_u64);
369    |                ^^^^^ expected u32, found u64
370 help: you can convert an `u64` to `u32` or panic if it the converted value wouldn't fit
371    |
372 LL |     foo::<u32>(x_u64.try_into().unwrap());
373    |                ^^^^^^^^^^^^^^^^^^^^^^^^^
374
375 error[E0308]: mismatched types
376   --> $DIR/numeric-cast.rs:115:16
377    |
378 LL |     foo::<u32>(x_u16);
379    |                ^^^^^
380    |                |
381    |                expected u32, found u16
382    |                help: you can convert an `u16` to `u32`: `x_u16.into()`
383
384 error[E0308]: mismatched types
385   --> $DIR/numeric-cast.rs:117:16
386    |
387 LL |     foo::<u32>(x_u8);
388    |                ^^^^
389    |                |
390    |                expected u32, found u8
391    |                help: you can convert an `u8` to `u32`: `x_u8.into()`
392
393 error[E0308]: mismatched types
394   --> $DIR/numeric-cast.rs:119:16
395    |
396 LL |     foo::<u32>(x_isize);
397    |                ^^^^^^^ expected u32, found isize
398 help: you can convert an `isize` to `u32` or panic if it the converted value wouldn't fit
399    |
400 LL |     foo::<u32>(x_isize.try_into().unwrap());
401    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
402
403 error[E0308]: mismatched types
404   --> $DIR/numeric-cast.rs:121:16
405    |
406 LL |     foo::<u32>(x_i64);
407    |                ^^^^^ expected u32, found i64
408 help: you can convert an `i64` to `u32` or panic if it the converted value wouldn't fit
409    |
410 LL |     foo::<u32>(x_i64.try_into().unwrap());
411    |                ^^^^^^^^^^^^^^^^^^^^^^^^^
412
413 error[E0308]: mismatched types
414   --> $DIR/numeric-cast.rs:123:16
415    |
416 LL |     foo::<u32>(x_i32);
417    |                ^^^^^ expected u32, found i32
418 help: you can convert an `i32` to `u32` or panic if it the converted value wouldn't fit
419    |
420 LL |     foo::<u32>(x_i32.try_into().unwrap());
421    |                ^^^^^^^^^^^^^^^^^^^^^^^^^
422
423 error[E0308]: mismatched types
424   --> $DIR/numeric-cast.rs:125:16
425    |
426 LL |     foo::<u32>(x_i16);
427    |                ^^^^^ expected u32, found i16
428 help: you can convert an `i16` to `u32` or panic if it the converted value wouldn't fit
429    |
430 LL |     foo::<u32>(x_i16.try_into().unwrap());
431    |                ^^^^^^^^^^^^^^^^^^^^^^^^^
432
433 error[E0308]: mismatched types
434   --> $DIR/numeric-cast.rs:127:16
435    |
436 LL |     foo::<u32>(x_i8);
437    |                ^^^^ expected u32, found i8
438 help: you can convert an `i8` to `u32` or panic if it the converted value wouldn't fit
439    |
440 LL |     foo::<u32>(x_i8.try_into().unwrap());
441    |                ^^^^^^^^^^^^^^^^^^^^^^^^
442
443 error[E0308]: mismatched types
444   --> $DIR/numeric-cast.rs:132:16
445    |
446 LL |     foo::<i32>(x_usize);
447    |                ^^^^^^^ expected i32, found usize
448 help: you can convert an `usize` to `i32` or panic if it the converted value wouldn't fit
449    |
450 LL |     foo::<i32>(x_usize.try_into().unwrap());
451    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
452
453 error[E0308]: mismatched types
454   --> $DIR/numeric-cast.rs:134:16
455    |
456 LL |     foo::<i32>(x_u64);
457    |                ^^^^^ expected i32, found u64
458 help: you can convert an `u64` to `i32` or panic if it the converted value wouldn't fit
459    |
460 LL |     foo::<i32>(x_u64.try_into().unwrap());
461    |                ^^^^^^^^^^^^^^^^^^^^^^^^^
462
463 error[E0308]: mismatched types
464   --> $DIR/numeric-cast.rs:136:16
465    |
466 LL |     foo::<i32>(x_u32);
467    |                ^^^^^ expected i32, found u32
468 help: you can convert an `u32` to `i32` or panic if it the converted value wouldn't fit
469    |
470 LL |     foo::<i32>(x_u32.try_into().unwrap());
471    |                ^^^^^^^^^^^^^^^^^^^^^^^^^
472
473 error[E0308]: mismatched types
474   --> $DIR/numeric-cast.rs:138:16
475    |
476 LL |     foo::<i32>(x_u16);
477    |                ^^^^^ expected i32, found u16
478 help: you can convert an `u16` to `i32` or panic if it the converted value wouldn't fit
479    |
480 LL |     foo::<i32>(x_u16.try_into().unwrap());
481    |                ^^^^^^^^^^^^^^^^^^^^^^^^^
482
483 error[E0308]: mismatched types
484   --> $DIR/numeric-cast.rs:140:16
485    |
486 LL |     foo::<i32>(x_u8);
487    |                ^^^^ expected i32, found u8
488 help: you can convert an `u8` to `i32` or panic if it the converted value wouldn't fit
489    |
490 LL |     foo::<i32>(x_u8.try_into().unwrap());
491    |                ^^^^^^^^^^^^^^^^^^^^^^^^
492
493 error[E0308]: mismatched types
494   --> $DIR/numeric-cast.rs:142:16
495    |
496 LL |     foo::<i32>(x_isize);
497    |                ^^^^^^^ expected i32, found isize
498 help: you can convert an `isize` to `i32` or panic if it the converted value wouldn't fit
499    |
500 LL |     foo::<i32>(x_isize.try_into().unwrap());
501    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
502
503 error[E0308]: mismatched types
504   --> $DIR/numeric-cast.rs:144:16
505    |
506 LL |     foo::<i32>(x_i64);
507    |                ^^^^^ expected i32, found i64
508 help: you can convert an `i64` to `i32` or panic if it the converted value wouldn't fit
509    |
510 LL |     foo::<i32>(x_i64.try_into().unwrap());
511    |                ^^^^^^^^^^^^^^^^^^^^^^^^^
512
513 error[E0308]: mismatched types
514   --> $DIR/numeric-cast.rs:147:16
515    |
516 LL |     foo::<i32>(x_i16);
517    |                ^^^^^
518    |                |
519    |                expected i32, found i16
520    |                help: you can convert an `i16` to `i32`: `x_i16.into()`
521
522 error[E0308]: mismatched types
523   --> $DIR/numeric-cast.rs:149:16
524    |
525 LL |     foo::<i32>(x_i8);
526    |                ^^^^
527    |                |
528    |                expected i32, found i8
529    |                help: you can convert an `i8` to `i32`: `x_i8.into()`
530
531 error[E0308]: mismatched types
532   --> $DIR/numeric-cast.rs:154:16
533    |
534 LL |     foo::<u16>(x_usize);
535    |                ^^^^^^^ expected u16, found usize
536 help: you can convert an `usize` to `u16` or panic if it the converted value wouldn't fit
537    |
538 LL |     foo::<u16>(x_usize.try_into().unwrap());
539    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
540
541 error[E0308]: mismatched types
542   --> $DIR/numeric-cast.rs:156:16
543    |
544 LL |     foo::<u16>(x_u64);
545    |                ^^^^^ expected u16, found u64
546 help: you can convert an `u64` to `u16` or panic if it the converted value wouldn't fit
547    |
548 LL |     foo::<u16>(x_u64.try_into().unwrap());
549    |                ^^^^^^^^^^^^^^^^^^^^^^^^^
550
551 error[E0308]: mismatched types
552   --> $DIR/numeric-cast.rs:158:16
553    |
554 LL |     foo::<u16>(x_u32);
555    |                ^^^^^ expected u16, found u32
556 help: you can convert an `u32` to `u16` or panic if it the converted value wouldn't fit
557    |
558 LL |     foo::<u16>(x_u32.try_into().unwrap());
559    |                ^^^^^^^^^^^^^^^^^^^^^^^^^
560
561 error[E0308]: mismatched types
562   --> $DIR/numeric-cast.rs:161:16
563    |
564 LL |     foo::<u16>(x_u8);
565    |                ^^^^
566    |                |
567    |                expected u16, found u8
568    |                help: you can convert an `u8` to `u16`: `x_u8.into()`
569
570 error[E0308]: mismatched types
571   --> $DIR/numeric-cast.rs:163:16
572    |
573 LL |     foo::<u16>(x_isize);
574    |                ^^^^^^^ expected u16, found isize
575 help: you can convert an `isize` to `u16` or panic if it the converted value wouldn't fit
576    |
577 LL |     foo::<u16>(x_isize.try_into().unwrap());
578    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
579
580 error[E0308]: mismatched types
581   --> $DIR/numeric-cast.rs:165:16
582    |
583 LL |     foo::<u16>(x_i64);
584    |                ^^^^^ expected u16, found i64
585 help: you can convert an `i64` to `u16` or panic if it the converted value wouldn't fit
586    |
587 LL |     foo::<u16>(x_i64.try_into().unwrap());
588    |                ^^^^^^^^^^^^^^^^^^^^^^^^^
589
590 error[E0308]: mismatched types
591   --> $DIR/numeric-cast.rs:167:16
592    |
593 LL |     foo::<u16>(x_i32);
594    |                ^^^^^ expected u16, found i32
595 help: you can convert an `i32` to `u16` or panic if it the converted value wouldn't fit
596    |
597 LL |     foo::<u16>(x_i32.try_into().unwrap());
598    |                ^^^^^^^^^^^^^^^^^^^^^^^^^
599
600 error[E0308]: mismatched types
601   --> $DIR/numeric-cast.rs:169:16
602    |
603 LL |     foo::<u16>(x_i16);
604    |                ^^^^^ expected u16, found i16
605 help: you can convert an `i16` to `u16` or panic if it the converted value wouldn't fit
606    |
607 LL |     foo::<u16>(x_i16.try_into().unwrap());
608    |                ^^^^^^^^^^^^^^^^^^^^^^^^^
609
610 error[E0308]: mismatched types
611   --> $DIR/numeric-cast.rs:171:16
612    |
613 LL |     foo::<u16>(x_i8);
614    |                ^^^^ expected u16, found i8
615 help: you can convert an `i8` to `u16` or panic if it the converted value wouldn't fit
616    |
617 LL |     foo::<u16>(x_i8.try_into().unwrap());
618    |                ^^^^^^^^^^^^^^^^^^^^^^^^
619
620 error[E0308]: mismatched types
621   --> $DIR/numeric-cast.rs:176:16
622    |
623 LL |     foo::<i16>(x_usize);
624    |                ^^^^^^^ expected i16, found usize
625 help: you can convert an `usize` to `i16` or panic if it the converted value wouldn't fit
626    |
627 LL |     foo::<i16>(x_usize.try_into().unwrap());
628    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
629
630 error[E0308]: mismatched types
631   --> $DIR/numeric-cast.rs:178:16
632    |
633 LL |     foo::<i16>(x_u64);
634    |                ^^^^^ expected i16, found u64
635 help: you can convert an `u64` to `i16` or panic if it the converted value wouldn't fit
636    |
637 LL |     foo::<i16>(x_u64.try_into().unwrap());
638    |                ^^^^^^^^^^^^^^^^^^^^^^^^^
639
640 error[E0308]: mismatched types
641   --> $DIR/numeric-cast.rs:180:16
642    |
643 LL |     foo::<i16>(x_u32);
644    |                ^^^^^ expected i16, found u32
645 help: you can convert an `u32` to `i16` or panic if it the converted value wouldn't fit
646    |
647 LL |     foo::<i16>(x_u32.try_into().unwrap());
648    |                ^^^^^^^^^^^^^^^^^^^^^^^^^
649
650 error[E0308]: mismatched types
651   --> $DIR/numeric-cast.rs:182:16
652    |
653 LL |     foo::<i16>(x_u16);
654    |                ^^^^^ expected i16, found u16
655 help: you can convert an `u16` to `i16` or panic if it the converted value wouldn't fit
656    |
657 LL |     foo::<i16>(x_u16.try_into().unwrap());
658    |                ^^^^^^^^^^^^^^^^^^^^^^^^^
659
660 error[E0308]: mismatched types
661   --> $DIR/numeric-cast.rs:184:16
662    |
663 LL |     foo::<i16>(x_u8);
664    |                ^^^^ expected i16, found u8
665 help: you can convert an `u8` to `i16` or panic if it the converted value wouldn't fit
666    |
667 LL |     foo::<i16>(x_u8.try_into().unwrap());
668    |                ^^^^^^^^^^^^^^^^^^^^^^^^
669
670 error[E0308]: mismatched types
671   --> $DIR/numeric-cast.rs:186:16
672    |
673 LL |     foo::<i16>(x_isize);
674    |                ^^^^^^^ expected i16, found isize
675 help: you can convert an `isize` to `i16` or panic if it the converted value wouldn't fit
676    |
677 LL |     foo::<i16>(x_isize.try_into().unwrap());
678    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
679
680 error[E0308]: mismatched types
681   --> $DIR/numeric-cast.rs:188:16
682    |
683 LL |     foo::<i16>(x_i64);
684    |                ^^^^^ expected i16, found i64
685 help: you can convert an `i64` to `i16` or panic if it the converted value wouldn't fit
686    |
687 LL |     foo::<i16>(x_i64.try_into().unwrap());
688    |                ^^^^^^^^^^^^^^^^^^^^^^^^^
689
690 error[E0308]: mismatched types
691   --> $DIR/numeric-cast.rs:190:16
692    |
693 LL |     foo::<i16>(x_i32);
694    |                ^^^^^ expected i16, found i32
695 help: you can convert an `i32` to `i16` or panic if it the converted value wouldn't fit
696    |
697 LL |     foo::<i16>(x_i32.try_into().unwrap());
698    |                ^^^^^^^^^^^^^^^^^^^^^^^^^
699
700 error[E0308]: mismatched types
701   --> $DIR/numeric-cast.rs:193:16
702    |
703 LL |     foo::<i16>(x_i8);
704    |                ^^^^
705    |                |
706    |                expected i16, found i8
707    |                help: you can convert an `i8` to `i16`: `x_i8.into()`
708
709 error[E0308]: mismatched types
710   --> $DIR/numeric-cast.rs:198:15
711    |
712 LL |     foo::<u8>(x_usize);
713    |               ^^^^^^^ expected u8, found usize
714 help: you can convert an `usize` to `u8` or panic if it the converted value wouldn't fit
715    |
716 LL |     foo::<u8>(x_usize.try_into().unwrap());
717    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
718
719 error[E0308]: mismatched types
720   --> $DIR/numeric-cast.rs:200:15
721    |
722 LL |     foo::<u8>(x_u64);
723    |               ^^^^^ expected u8, found u64
724 help: you can convert an `u64` to `u8` or panic if it the converted value wouldn't fit
725    |
726 LL |     foo::<u8>(x_u64.try_into().unwrap());
727    |               ^^^^^^^^^^^^^^^^^^^^^^^^^
728
729 error[E0308]: mismatched types
730   --> $DIR/numeric-cast.rs:202:15
731    |
732 LL |     foo::<u8>(x_u32);
733    |               ^^^^^ expected u8, found u32
734 help: you can convert an `u32` to `u8` or panic if it the converted value wouldn't fit
735    |
736 LL |     foo::<u8>(x_u32.try_into().unwrap());
737    |               ^^^^^^^^^^^^^^^^^^^^^^^^^
738
739 error[E0308]: mismatched types
740   --> $DIR/numeric-cast.rs:204:15
741    |
742 LL |     foo::<u8>(x_u16);
743    |               ^^^^^ expected u8, found u16
744 help: you can convert an `u16` to `u8` or panic if it the converted value wouldn't fit
745    |
746 LL |     foo::<u8>(x_u16.try_into().unwrap());
747    |               ^^^^^^^^^^^^^^^^^^^^^^^^^
748
749 error[E0308]: mismatched types
750   --> $DIR/numeric-cast.rs:207:15
751    |
752 LL |     foo::<u8>(x_isize);
753    |               ^^^^^^^ expected u8, found isize
754 help: you can convert an `isize` to `u8` or panic if it the converted value wouldn't fit
755    |
756 LL |     foo::<u8>(x_isize.try_into().unwrap());
757    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
758
759 error[E0308]: mismatched types
760   --> $DIR/numeric-cast.rs:209:15
761    |
762 LL |     foo::<u8>(x_i64);
763    |               ^^^^^ expected u8, found i64
764 help: you can convert an `i64` to `u8` or panic if it the converted value wouldn't fit
765    |
766 LL |     foo::<u8>(x_i64.try_into().unwrap());
767    |               ^^^^^^^^^^^^^^^^^^^^^^^^^
768
769 error[E0308]: mismatched types
770   --> $DIR/numeric-cast.rs:211:15
771    |
772 LL |     foo::<u8>(x_i32);
773    |               ^^^^^ expected u8, found i32
774 help: you can convert an `i32` to `u8` or panic if it the converted value wouldn't fit
775    |
776 LL |     foo::<u8>(x_i32.try_into().unwrap());
777    |               ^^^^^^^^^^^^^^^^^^^^^^^^^
778
779 error[E0308]: mismatched types
780   --> $DIR/numeric-cast.rs:213:15
781    |
782 LL |     foo::<u8>(x_i16);
783    |               ^^^^^ expected u8, found i16
784 help: you can convert an `i16` to `u8` or panic if it the converted value wouldn't fit
785    |
786 LL |     foo::<u8>(x_i16.try_into().unwrap());
787    |               ^^^^^^^^^^^^^^^^^^^^^^^^^
788
789 error[E0308]: mismatched types
790   --> $DIR/numeric-cast.rs:215:15
791    |
792 LL |     foo::<u8>(x_i8);
793    |               ^^^^ expected u8, found i8
794 help: you can convert an `i8` to `u8` or panic if it the converted value wouldn't fit
795    |
796 LL |     foo::<u8>(x_i8.try_into().unwrap());
797    |               ^^^^^^^^^^^^^^^^^^^^^^^^
798
799 error[E0308]: mismatched types
800   --> $DIR/numeric-cast.rs:220:15
801    |
802 LL |     foo::<i8>(x_usize);
803    |               ^^^^^^^ expected i8, found usize
804 help: you can convert an `usize` to `i8` or panic if it the converted value wouldn't fit
805    |
806 LL |     foo::<i8>(x_usize.try_into().unwrap());
807    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
808
809 error[E0308]: mismatched types
810   --> $DIR/numeric-cast.rs:222:15
811    |
812 LL |     foo::<i8>(x_u64);
813    |               ^^^^^ expected i8, found u64
814 help: you can convert an `u64` to `i8` or panic if it the converted value wouldn't fit
815    |
816 LL |     foo::<i8>(x_u64.try_into().unwrap());
817    |               ^^^^^^^^^^^^^^^^^^^^^^^^^
818
819 error[E0308]: mismatched types
820   --> $DIR/numeric-cast.rs:224:15
821    |
822 LL |     foo::<i8>(x_u32);
823    |               ^^^^^ expected i8, found u32
824 help: you can convert an `u32` to `i8` or panic if it the converted value wouldn't fit
825    |
826 LL |     foo::<i8>(x_u32.try_into().unwrap());
827    |               ^^^^^^^^^^^^^^^^^^^^^^^^^
828
829 error[E0308]: mismatched types
830   --> $DIR/numeric-cast.rs:226:15
831    |
832 LL |     foo::<i8>(x_u16);
833    |               ^^^^^ expected i8, found u16
834 help: you can convert an `u16` to `i8` or panic if it the converted value wouldn't fit
835    |
836 LL |     foo::<i8>(x_u16.try_into().unwrap());
837    |               ^^^^^^^^^^^^^^^^^^^^^^^^^
838
839 error[E0308]: mismatched types
840   --> $DIR/numeric-cast.rs:228:15
841    |
842 LL |     foo::<i8>(x_u8);
843    |               ^^^^ expected i8, found u8
844 help: you can convert an `u8` to `i8` or panic if it the converted value wouldn't fit
845    |
846 LL |     foo::<i8>(x_u8.try_into().unwrap());
847    |               ^^^^^^^^^^^^^^^^^^^^^^^^
848
849 error[E0308]: mismatched types
850   --> $DIR/numeric-cast.rs:230:15
851    |
852 LL |     foo::<i8>(x_isize);
853    |               ^^^^^^^ expected i8, found isize
854 help: you can convert an `isize` to `i8` or panic if it the converted value wouldn't fit
855    |
856 LL |     foo::<i8>(x_isize.try_into().unwrap());
857    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
858
859 error[E0308]: mismatched types
860   --> $DIR/numeric-cast.rs:232:15
861    |
862 LL |     foo::<i8>(x_i64);
863    |               ^^^^^ expected i8, found i64
864 help: you can convert an `i64` to `i8` or panic if it the converted value wouldn't fit
865    |
866 LL |     foo::<i8>(x_i64.try_into().unwrap());
867    |               ^^^^^^^^^^^^^^^^^^^^^^^^^
868
869 error[E0308]: mismatched types
870   --> $DIR/numeric-cast.rs:234:15
871    |
872 LL |     foo::<i8>(x_i32);
873    |               ^^^^^ expected i8, found i32
874 help: you can convert an `i32` to `i8` or panic if it the converted value wouldn't fit
875    |
876 LL |     foo::<i8>(x_i32.try_into().unwrap());
877    |               ^^^^^^^^^^^^^^^^^^^^^^^^^
878
879 error[E0308]: mismatched types
880   --> $DIR/numeric-cast.rs:236:15
881    |
882 LL |     foo::<i8>(x_i16);
883    |               ^^^^^ expected i8, found i16
884 help: you can convert an `i16` to `i8` or panic if it the converted value wouldn't fit
885    |
886 LL |     foo::<i8>(x_i16.try_into().unwrap());
887    |               ^^^^^^^^^^^^^^^^^^^^^^^^^
888
889 error[E0308]: mismatched types
890   --> $DIR/numeric-cast.rs:242:16
891    |
892 LL |     foo::<f64>(x_usize);
893    |                ^^^^^^^ expected f64, found usize
894 help: you can cast an `usize to `f64`, producing the floating point representation of the integer,
895    |                                              rounded if necessary
896 LL |     foo::<f64>(x_usize as f64);
897    |                ^^^^^^^^^^^^^^
898
899 error[E0308]: mismatched types
900   --> $DIR/numeric-cast.rs:244:16
901    |
902 LL |     foo::<f64>(x_u64);
903    |                ^^^^^ expected f64, found u64
904 help: you can cast an `u64 to `f64`, producing the floating point representation of the integer,
905    |                                              rounded if necessary
906 LL |     foo::<f64>(x_u64 as f64);
907    |                ^^^^^^^^^^^^
908
909 error[E0308]: mismatched types
910   --> $DIR/numeric-cast.rs:246:16
911    |
912 LL |     foo::<f64>(x_u32);
913    |                ^^^^^ expected f64, found u32
914 help: you can convert an `u32` to `f64`, producing the floating point representation of the integer
915    |
916 LL |     foo::<f64>(x_u32.into());
917    |                ^^^^^^^^^^^^
918
919 error[E0308]: mismatched types
920   --> $DIR/numeric-cast.rs:248:16
921    |
922 LL |     foo::<f64>(x_u16);
923    |                ^^^^^ expected f64, found u16
924 help: you can convert an `u16` to `f64`, producing the floating point representation of the integer
925    |
926 LL |     foo::<f64>(x_u16.into());
927    |                ^^^^^^^^^^^^
928
929 error[E0308]: mismatched types
930   --> $DIR/numeric-cast.rs:250:16
931    |
932 LL |     foo::<f64>(x_u8);
933    |                ^^^^ expected f64, found u8
934 help: you can convert an `u8` to `f64`, producing the floating point representation of the integer
935    |
936 LL |     foo::<f64>(x_u8.into());
937    |                ^^^^^^^^^^^
938
939 error[E0308]: mismatched types
940   --> $DIR/numeric-cast.rs:252:16
941    |
942 LL |     foo::<f64>(x_isize);
943    |                ^^^^^^^ expected f64, found isize
944 help: you can convert an `isize` to `f64`, producing the floating point representation of the integer, rounded if necessary
945    |
946 LL |     foo::<f64>(x_isize as f64);
947    |                ^^^^^^^^^^^^^^
948
949 error[E0308]: mismatched types
950   --> $DIR/numeric-cast.rs:254:16
951    |
952 LL |     foo::<f64>(x_i64);
953    |                ^^^^^ expected f64, found i64
954 help: you can convert an `i64` to `f64`, producing the floating point representation of the integer, rounded if necessary
955    |
956 LL |     foo::<f64>(x_i64 as f64);
957    |                ^^^^^^^^^^^^
958
959 error[E0308]: mismatched types
960   --> $DIR/numeric-cast.rs:256:16
961    |
962 LL |     foo::<f64>(x_i32);
963    |                ^^^^^ expected f64, found i32
964 help: you can convert an `i32` to `f64`, producing the floating point representation of the integer
965    |
966 LL |     foo::<f64>(x_i32.into());
967    |                ^^^^^^^^^^^^
968
969 error[E0308]: mismatched types
970   --> $DIR/numeric-cast.rs:258:16
971    |
972 LL |     foo::<f64>(x_i16);
973    |                ^^^^^ expected f64, found i16
974 help: you can convert an `i16` to `f64`, producing the floating point representation of the integer
975    |
976 LL |     foo::<f64>(x_i16.into());
977    |                ^^^^^^^^^^^^
978
979 error[E0308]: mismatched types
980   --> $DIR/numeric-cast.rs:260:16
981    |
982 LL |     foo::<f64>(x_i8);
983    |                ^^^^ expected f64, found i8
984 help: you can convert an `i8` to `f64`, producing the floating point representation of the integer
985    |
986 LL |     foo::<f64>(x_i8.into());
987    |                ^^^^^^^^^^^
988
989 error[E0308]: mismatched types
990   --> $DIR/numeric-cast.rs:263:16
991    |
992 LL |     foo::<f64>(x_f32);
993    |                ^^^^^
994    |                |
995    |                expected f64, found f32
996    |                help: you can convert an `f32` to `f64`: `x_f32.into()`
997
998 error[E0308]: mismatched types
999   --> $DIR/numeric-cast.rs:266:16
1000    |
1001 LL |     foo::<f32>(x_usize);
1002    |                ^^^^^^^ expected f32, found usize
1003 help: you can cast an `usize to `f32`, producing the floating point representation of the integer,
1004    |                                              rounded if necessary
1005 LL |     foo::<f32>(x_usize as f32);
1006    |                ^^^^^^^^^^^^^^
1007
1008 error[E0308]: mismatched types
1009   --> $DIR/numeric-cast.rs:268:16
1010    |
1011 LL |     foo::<f32>(x_u64);
1012    |                ^^^^^ expected f32, found u64
1013 help: you can cast an `u64 to `f32`, producing the floating point representation of the integer,
1014    |                                              rounded if necessary
1015 LL |     foo::<f32>(x_u64 as f32);
1016    |                ^^^^^^^^^^^^
1017
1018 error[E0308]: mismatched types
1019   --> $DIR/numeric-cast.rs:270:16
1020    |
1021 LL |     foo::<f32>(x_u32);
1022    |                ^^^^^ expected f32, found u32
1023 help: you can cast an `u32 to `f32`, producing the floating point representation of the integer,
1024    |                                              rounded if necessary
1025 LL |     foo::<f32>(x_u32 as f32);
1026    |                ^^^^^^^^^^^^
1027
1028 error[E0308]: mismatched types
1029   --> $DIR/numeric-cast.rs:272:16
1030    |
1031 LL |     foo::<f32>(x_u16);
1032    |                ^^^^^ expected f32, found u16
1033 help: you can convert an `u16` to `f32`, producing the floating point representation of the integer
1034    |
1035 LL |     foo::<f32>(x_u16.into());
1036    |                ^^^^^^^^^^^^
1037
1038 error[E0308]: mismatched types
1039   --> $DIR/numeric-cast.rs:274:16
1040    |
1041 LL |     foo::<f32>(x_u8);
1042    |                ^^^^ expected f32, found u8
1043 help: you can convert an `u8` to `f32`, producing the floating point representation of the integer
1044    |
1045 LL |     foo::<f32>(x_u8.into());
1046    |                ^^^^^^^^^^^
1047
1048 error[E0308]: mismatched types
1049   --> $DIR/numeric-cast.rs:276:16
1050    |
1051 LL |     foo::<f32>(x_isize);
1052    |                ^^^^^^^ expected f32, found isize
1053 help: you can convert an `isize` to `f32`, producing the floating point representation of the integer, rounded if necessary
1054    |
1055 LL |     foo::<f32>(x_isize as f32);
1056    |                ^^^^^^^^^^^^^^
1057
1058 error[E0308]: mismatched types
1059   --> $DIR/numeric-cast.rs:278:16
1060    |
1061 LL |     foo::<f32>(x_i64);
1062    |                ^^^^^ expected f32, found i64
1063 help: you can convert an `i64` to `f32`, producing the floating point representation of the integer, rounded if necessary
1064    |
1065 LL |     foo::<f32>(x_i64 as f32);
1066    |                ^^^^^^^^^^^^
1067
1068 error[E0308]: mismatched types
1069   --> $DIR/numeric-cast.rs:280:16
1070    |
1071 LL |     foo::<f32>(x_i32);
1072    |                ^^^^^ expected f32, found i32
1073 help: you can convert an `i32` to `f32`, producing the floating point representation of the integer, rounded if necessary
1074    |
1075 LL |     foo::<f32>(x_i32 as f32);
1076    |                ^^^^^^^^^^^^
1077
1078 error[E0308]: mismatched types
1079   --> $DIR/numeric-cast.rs:282:16
1080    |
1081 LL |     foo::<f32>(x_i16);
1082    |                ^^^^^ expected f32, found i16
1083 help: you can convert an `i16` to `f32`, producing the floating point representation of the integer
1084    |
1085 LL |     foo::<f32>(x_i16.into());
1086    |                ^^^^^^^^^^^^
1087
1088 error[E0308]: mismatched types
1089   --> $DIR/numeric-cast.rs:284:16
1090    |
1091 LL |     foo::<f32>(x_i8);
1092    |                ^^^^ expected f32, found i8
1093 help: you can convert an `i8` to `f32`, producing the floating point representation of the integer
1094    |
1095 LL |     foo::<f32>(x_i8.into());
1096    |                ^^^^^^^^^^^
1097
1098 error[E0308]: mismatched types
1099   --> $DIR/numeric-cast.rs:289:16
1100    |
1101 LL |     foo::<u32>(x_u8 as u16);
1102    |                ^^^^^^^^^^^
1103    |                |
1104    |                expected u32, found u16
1105    |                help: you can convert an `u16` to `u32`: `(x_u8 as u16).into()`
1106
1107 error[E0308]: mismatched types
1108   --> $DIR/numeric-cast.rs:291:16
1109    |
1110 LL |     foo::<i32>(-x_i8);
1111    |                ^^^^^
1112    |                |
1113    |                expected i32, found i8
1114    |                help: you can convert an `i8` to `i32`: `(-x_i8).into()`
1115
1116 error: aborting due to 113 previous errors
1117
1118 For more information about this error, try `rustc --explain E0308`.