]> git.proxmox.com Git - rustc.git/blob - src/test/ui/suggestions/numeric-cast.stderr
New upstream version 1.25.0+dfsg1
[rustc.git] / src / test / ui / suggestions / numeric-cast.stderr
1 error[E0308]: mismatched types
2 --> $DIR/numeric-cast.rs:29:18
3 |
4 29 | foo::<usize>(x_u64);
5 | ^^^^^ expected usize, found u64
6
7 error[E0308]: mismatched types
8 --> $DIR/numeric-cast.rs:31:18
9 |
10 31 | foo::<usize>(x_u32);
11 | ^^^^^ expected usize, found u32
12
13 error[E0308]: mismatched types
14 --> $DIR/numeric-cast.rs:33:18
15 |
16 33 | foo::<usize>(x_u16);
17 | ^^^^^ expected usize, found u16
18
19 error[E0308]: mismatched types
20 --> $DIR/numeric-cast.rs:35:18
21 |
22 35 | foo::<usize>(x_u8);
23 | ^^^^ expected usize, found u8
24
25 error[E0308]: mismatched types
26 --> $DIR/numeric-cast.rs:37:18
27 |
28 37 | foo::<usize>(x_isize);
29 | ^^^^^^^ expected usize, found isize
30
31 error[E0308]: mismatched types
32 --> $DIR/numeric-cast.rs:39:18
33 |
34 39 | foo::<usize>(x_i64);
35 | ^^^^^ expected usize, found i64
36
37 error[E0308]: mismatched types
38 --> $DIR/numeric-cast.rs:41:18
39 |
40 41 | foo::<usize>(x_i32);
41 | ^^^^^ expected usize, found i32
42
43 error[E0308]: mismatched types
44 --> $DIR/numeric-cast.rs:43:18
45 |
46 43 | foo::<usize>(x_i16);
47 | ^^^^^ expected usize, found i16
48
49 error[E0308]: mismatched types
50 --> $DIR/numeric-cast.rs:45:18
51 |
52 45 | foo::<usize>(x_i8);
53 | ^^^^ expected usize, found i8
54
55 error[E0308]: mismatched types
56 --> $DIR/numeric-cast.rs:47:18
57 |
58 47 | foo::<usize>(x_f64);
59 | ^^^^^ expected usize, found f64
60
61 error[E0308]: mismatched types
62 --> $DIR/numeric-cast.rs:49:18
63 |
64 49 | foo::<usize>(x_f32);
65 | ^^^^^ expected usize, found f32
66
67 error[E0308]: mismatched types
68 --> $DIR/numeric-cast.rs:52:18
69 |
70 52 | foo::<isize>(x_usize);
71 | ^^^^^^^ expected isize, found usize
72
73 error[E0308]: mismatched types
74 --> $DIR/numeric-cast.rs:54:18
75 |
76 54 | foo::<isize>(x_u64);
77 | ^^^^^ expected isize, found u64
78
79 error[E0308]: mismatched types
80 --> $DIR/numeric-cast.rs:56:18
81 |
82 56 | foo::<isize>(x_u32);
83 | ^^^^^ expected isize, found u32
84
85 error[E0308]: mismatched types
86 --> $DIR/numeric-cast.rs:58:18
87 |
88 58 | foo::<isize>(x_u16);
89 | ^^^^^ expected isize, found u16
90
91 error[E0308]: mismatched types
92 --> $DIR/numeric-cast.rs:60:18
93 |
94 60 | foo::<isize>(x_u8);
95 | ^^^^ expected isize, found u8
96
97 error[E0308]: mismatched types
98 --> $DIR/numeric-cast.rs:63:18
99 |
100 63 | foo::<isize>(x_i64);
101 | ^^^^^ expected isize, found i64
102
103 error[E0308]: mismatched types
104 --> $DIR/numeric-cast.rs:65:18
105 |
106 65 | foo::<isize>(x_i32);
107 | ^^^^^ expected isize, found i32
108
109 error[E0308]: mismatched types
110 --> $DIR/numeric-cast.rs:67:18
111 |
112 67 | foo::<isize>(x_i16);
113 | ^^^^^ expected isize, found i16
114
115 error[E0308]: mismatched types
116 --> $DIR/numeric-cast.rs:69:18
117 |
118 69 | foo::<isize>(x_i8);
119 | ^^^^ expected isize, found i8
120
121 error[E0308]: mismatched types
122 --> $DIR/numeric-cast.rs:71:18
123 |
124 71 | foo::<isize>(x_f64);
125 | ^^^^^ expected isize, found f64
126
127 error[E0308]: mismatched types
128 --> $DIR/numeric-cast.rs:73:18
129 |
130 73 | foo::<isize>(x_f32);
131 | ^^^^^ expected isize, found f32
132
133 error[E0308]: mismatched types
134 --> $DIR/numeric-cast.rs:76:16
135 |
136 76 | foo::<u64>(x_usize);
137 | ^^^^^^^ expected u64, found usize
138
139 error[E0308]: mismatched types
140 --> $DIR/numeric-cast.rs:79:16
141 |
142 79 | foo::<u64>(x_u32);
143 | ^^^^^ expected u64, found u32
144 help: you can cast an `u32` to `u64`, which will zero-extend the source value
145 |
146 79 | foo::<u64>(x_u32.into());
147 | ^^^^^^^^^^^^
148
149 error[E0308]: mismatched types
150 --> $DIR/numeric-cast.rs:81:16
151 |
152 81 | foo::<u64>(x_u16);
153 | ^^^^^ expected u64, found u16
154 help: you can cast an `u16` to `u64`, which will zero-extend the source value
155 |
156 81 | foo::<u64>(x_u16.into());
157 | ^^^^^^^^^^^^
158
159 error[E0308]: mismatched types
160 --> $DIR/numeric-cast.rs:83:16
161 |
162 83 | foo::<u64>(x_u8);
163 | ^^^^ expected u64, found u8
164 help: you can cast an `u8` to `u64`, which will zero-extend the source value
165 |
166 83 | foo::<u64>(x_u8.into());
167 | ^^^^^^^^^^^
168
169 error[E0308]: mismatched types
170 --> $DIR/numeric-cast.rs:85:16
171 |
172 85 | foo::<u64>(x_isize);
173 | ^^^^^^^ expected u64, found isize
174
175 error[E0308]: mismatched types
176 --> $DIR/numeric-cast.rs:87:16
177 |
178 87 | foo::<u64>(x_i64);
179 | ^^^^^ expected u64, found i64
180
181 error[E0308]: mismatched types
182 --> $DIR/numeric-cast.rs:89:16
183 |
184 89 | foo::<u64>(x_i32);
185 | ^^^^^ expected u64, found i32
186
187 error[E0308]: mismatched types
188 --> $DIR/numeric-cast.rs:91:16
189 |
190 91 | foo::<u64>(x_i16);
191 | ^^^^^ expected u64, found i16
192
193 error[E0308]: mismatched types
194 --> $DIR/numeric-cast.rs:93:16
195 |
196 93 | foo::<u64>(x_i8);
197 | ^^^^ expected u64, found i8
198
199 error[E0308]: mismatched types
200 --> $DIR/numeric-cast.rs:95:16
201 |
202 95 | foo::<u64>(x_f64);
203 | ^^^^^ expected u64, found f64
204
205 error[E0308]: mismatched types
206 --> $DIR/numeric-cast.rs:97:16
207 |
208 97 | foo::<u64>(x_f32);
209 | ^^^^^ expected u64, found f32
210
211 error[E0308]: mismatched types
212 --> $DIR/numeric-cast.rs:100:16
213 |
214 100 | foo::<i64>(x_usize);
215 | ^^^^^^^ expected i64, found usize
216
217 error[E0308]: mismatched types
218 --> $DIR/numeric-cast.rs:102:16
219 |
220 102 | foo::<i64>(x_u64);
221 | ^^^^^ expected i64, found u64
222
223 error[E0308]: mismatched types
224 --> $DIR/numeric-cast.rs:104:16
225 |
226 104 | foo::<i64>(x_u32);
227 | ^^^^^ expected i64, found u32
228
229 error[E0308]: mismatched types
230 --> $DIR/numeric-cast.rs:106:16
231 |
232 106 | foo::<i64>(x_u16);
233 | ^^^^^ expected i64, found u16
234
235 error[E0308]: mismatched types
236 --> $DIR/numeric-cast.rs:108:16
237 |
238 108 | foo::<i64>(x_u8);
239 | ^^^^ expected i64, found u8
240
241 error[E0308]: mismatched types
242 --> $DIR/numeric-cast.rs:110:16
243 |
244 110 | foo::<i64>(x_isize);
245 | ^^^^^^^ expected i64, found isize
246
247 error[E0308]: mismatched types
248 --> $DIR/numeric-cast.rs:113:16
249 |
250 113 | foo::<i64>(x_i32);
251 | ^^^^^ expected i64, found i32
252 help: you can cast an `i32` to `i64`, which will sign-extend the source value
253 |
254 113 | foo::<i64>(x_i32.into());
255 | ^^^^^^^^^^^^
256
257 error[E0308]: mismatched types
258 --> $DIR/numeric-cast.rs:115:16
259 |
260 115 | foo::<i64>(x_i16);
261 | ^^^^^ expected i64, found i16
262 help: you can cast an `i16` to `i64`, which will sign-extend the source value
263 |
264 115 | foo::<i64>(x_i16.into());
265 | ^^^^^^^^^^^^
266
267 error[E0308]: mismatched types
268 --> $DIR/numeric-cast.rs:117:16
269 |
270 117 | foo::<i64>(x_i8);
271 | ^^^^ expected i64, found i8
272 help: you can cast an `i8` to `i64`, which will sign-extend the source value
273 |
274 117 | foo::<i64>(x_i8.into());
275 | ^^^^^^^^^^^
276
277 error[E0308]: mismatched types
278 --> $DIR/numeric-cast.rs:119:16
279 |
280 119 | foo::<i64>(x_f64);
281 | ^^^^^ expected i64, found f64
282
283 error[E0308]: mismatched types
284 --> $DIR/numeric-cast.rs:121:16
285 |
286 121 | foo::<i64>(x_f32);
287 | ^^^^^ expected i64, found f32
288
289 error[E0308]: mismatched types
290 --> $DIR/numeric-cast.rs:124:16
291 |
292 124 | foo::<u32>(x_usize);
293 | ^^^^^^^ expected u32, found usize
294
295 error[E0308]: mismatched types
296 --> $DIR/numeric-cast.rs:126:16
297 |
298 126 | foo::<u32>(x_u64);
299 | ^^^^^ expected u32, found u64
300
301 error[E0308]: mismatched types
302 --> $DIR/numeric-cast.rs:129:16
303 |
304 129 | foo::<u32>(x_u16);
305 | ^^^^^ expected u32, found u16
306 help: you can cast an `u16` to `u32`, which will zero-extend the source value
307 |
308 129 | foo::<u32>(x_u16.into());
309 | ^^^^^^^^^^^^
310
311 error[E0308]: mismatched types
312 --> $DIR/numeric-cast.rs:131:16
313 |
314 131 | foo::<u32>(x_u8);
315 | ^^^^ expected u32, found u8
316 help: you can cast an `u8` to `u32`, which will zero-extend the source value
317 |
318 131 | foo::<u32>(x_u8.into());
319 | ^^^^^^^^^^^
320
321 error[E0308]: mismatched types
322 --> $DIR/numeric-cast.rs:133:16
323 |
324 133 | foo::<u32>(x_isize);
325 | ^^^^^^^ expected u32, found isize
326
327 error[E0308]: mismatched types
328 --> $DIR/numeric-cast.rs:135:16
329 |
330 135 | foo::<u32>(x_i64);
331 | ^^^^^ expected u32, found i64
332
333 error[E0308]: mismatched types
334 --> $DIR/numeric-cast.rs:137:16
335 |
336 137 | foo::<u32>(x_i32);
337 | ^^^^^ expected u32, found i32
338
339 error[E0308]: mismatched types
340 --> $DIR/numeric-cast.rs:139:16
341 |
342 139 | foo::<u32>(x_i16);
343 | ^^^^^ expected u32, found i16
344
345 error[E0308]: mismatched types
346 --> $DIR/numeric-cast.rs:141:16
347 |
348 141 | foo::<u32>(x_i8);
349 | ^^^^ expected u32, found i8
350
351 error[E0308]: mismatched types
352 --> $DIR/numeric-cast.rs:143:16
353 |
354 143 | foo::<u32>(x_f64);
355 | ^^^^^ expected u32, found f64
356
357 error[E0308]: mismatched types
358 --> $DIR/numeric-cast.rs:145:16
359 |
360 145 | foo::<u32>(x_f32);
361 | ^^^^^ expected u32, found f32
362
363 error[E0308]: mismatched types
364 --> $DIR/numeric-cast.rs:148:16
365 |
366 148 | foo::<i32>(x_usize);
367 | ^^^^^^^ expected i32, found usize
368
369 error[E0308]: mismatched types
370 --> $DIR/numeric-cast.rs:150:16
371 |
372 150 | foo::<i32>(x_u64);
373 | ^^^^^ expected i32, found u64
374
375 error[E0308]: mismatched types
376 --> $DIR/numeric-cast.rs:152:16
377 |
378 152 | foo::<i32>(x_u32);
379 | ^^^^^ expected i32, found u32
380
381 error[E0308]: mismatched types
382 --> $DIR/numeric-cast.rs:154:16
383 |
384 154 | foo::<i32>(x_u16);
385 | ^^^^^ expected i32, found u16
386
387 error[E0308]: mismatched types
388 --> $DIR/numeric-cast.rs:156:16
389 |
390 156 | foo::<i32>(x_u8);
391 | ^^^^ expected i32, found u8
392
393 error[E0308]: mismatched types
394 --> $DIR/numeric-cast.rs:158:16
395 |
396 158 | foo::<i32>(x_isize);
397 | ^^^^^^^ expected i32, found isize
398
399 error[E0308]: mismatched types
400 --> $DIR/numeric-cast.rs:160:16
401 |
402 160 | foo::<i32>(x_i64);
403 | ^^^^^ expected i32, found i64
404
405 error[E0308]: mismatched types
406 --> $DIR/numeric-cast.rs:163:16
407 |
408 163 | foo::<i32>(x_i16);
409 | ^^^^^ expected i32, found i16
410 help: you can cast an `i16` to `i32`, which will sign-extend the source value
411 |
412 163 | foo::<i32>(x_i16.into());
413 | ^^^^^^^^^^^^
414
415 error[E0308]: mismatched types
416 --> $DIR/numeric-cast.rs:165:16
417 |
418 165 | foo::<i32>(x_i8);
419 | ^^^^ expected i32, found i8
420 help: you can cast an `i8` to `i32`, which will sign-extend the source value
421 |
422 165 | foo::<i32>(x_i8.into());
423 | ^^^^^^^^^^^
424
425 error[E0308]: mismatched types
426 --> $DIR/numeric-cast.rs:167:16
427 |
428 167 | foo::<i32>(x_f64);
429 | ^^^^^ expected i32, found f64
430
431 error[E0308]: mismatched types
432 --> $DIR/numeric-cast.rs:169:16
433 |
434 169 | foo::<i32>(x_f32);
435 | ^^^^^ expected i32, found f32
436
437 error[E0308]: mismatched types
438 --> $DIR/numeric-cast.rs:172:16
439 |
440 172 | foo::<u16>(x_usize);
441 | ^^^^^^^ expected u16, found usize
442
443 error[E0308]: mismatched types
444 --> $DIR/numeric-cast.rs:174:16
445 |
446 174 | foo::<u16>(x_u64);
447 | ^^^^^ expected u16, found u64
448
449 error[E0308]: mismatched types
450 --> $DIR/numeric-cast.rs:176:16
451 |
452 176 | foo::<u16>(x_u32);
453 | ^^^^^ expected u16, found u32
454
455 error[E0308]: mismatched types
456 --> $DIR/numeric-cast.rs:179:16
457 |
458 179 | foo::<u16>(x_u8);
459 | ^^^^ expected u16, found u8
460 help: you can cast an `u8` to `u16`, which will zero-extend the source value
461 |
462 179 | foo::<u16>(x_u8.into());
463 | ^^^^^^^^^^^
464
465 error[E0308]: mismatched types
466 --> $DIR/numeric-cast.rs:181:16
467 |
468 181 | foo::<u16>(x_isize);
469 | ^^^^^^^ expected u16, found isize
470
471 error[E0308]: mismatched types
472 --> $DIR/numeric-cast.rs:183:16
473 |
474 183 | foo::<u16>(x_i64);
475 | ^^^^^ expected u16, found i64
476
477 error[E0308]: mismatched types
478 --> $DIR/numeric-cast.rs:185:16
479 |
480 185 | foo::<u16>(x_i32);
481 | ^^^^^ expected u16, found i32
482
483 error[E0308]: mismatched types
484 --> $DIR/numeric-cast.rs:187:16
485 |
486 187 | foo::<u16>(x_i16);
487 | ^^^^^ expected u16, found i16
488
489 error[E0308]: mismatched types
490 --> $DIR/numeric-cast.rs:189:16
491 |
492 189 | foo::<u16>(x_i8);
493 | ^^^^ expected u16, found i8
494
495 error[E0308]: mismatched types
496 --> $DIR/numeric-cast.rs:191:16
497 |
498 191 | foo::<u16>(x_f64);
499 | ^^^^^ expected u16, found f64
500
501 error[E0308]: mismatched types
502 --> $DIR/numeric-cast.rs:193:16
503 |
504 193 | foo::<u16>(x_f32);
505 | ^^^^^ expected u16, found f32
506
507 error[E0308]: mismatched types
508 --> $DIR/numeric-cast.rs:196:16
509 |
510 196 | foo::<i16>(x_usize);
511 | ^^^^^^^ expected i16, found usize
512
513 error[E0308]: mismatched types
514 --> $DIR/numeric-cast.rs:198:16
515 |
516 198 | foo::<i16>(x_u64);
517 | ^^^^^ expected i16, found u64
518
519 error[E0308]: mismatched types
520 --> $DIR/numeric-cast.rs:200:16
521 |
522 200 | foo::<i16>(x_u32);
523 | ^^^^^ expected i16, found u32
524
525 error[E0308]: mismatched types
526 --> $DIR/numeric-cast.rs:202:16
527 |
528 202 | foo::<i16>(x_u16);
529 | ^^^^^ expected i16, found u16
530
531 error[E0308]: mismatched types
532 --> $DIR/numeric-cast.rs:204:16
533 |
534 204 | foo::<i16>(x_u8);
535 | ^^^^ expected i16, found u8
536
537 error[E0308]: mismatched types
538 --> $DIR/numeric-cast.rs:206:16
539 |
540 206 | foo::<i16>(x_isize);
541 | ^^^^^^^ expected i16, found isize
542
543 error[E0308]: mismatched types
544 --> $DIR/numeric-cast.rs:208:16
545 |
546 208 | foo::<i16>(x_i64);
547 | ^^^^^ expected i16, found i64
548
549 error[E0308]: mismatched types
550 --> $DIR/numeric-cast.rs:210:16
551 |
552 210 | foo::<i16>(x_i32);
553 | ^^^^^ expected i16, found i32
554
555 error[E0308]: mismatched types
556 --> $DIR/numeric-cast.rs:213:16
557 |
558 213 | foo::<i16>(x_i8);
559 | ^^^^ expected i16, found i8
560 help: you can cast an `i8` to `i16`, which will sign-extend the source value
561 |
562 213 | foo::<i16>(x_i8.into());
563 | ^^^^^^^^^^^
564
565 error[E0308]: mismatched types
566 --> $DIR/numeric-cast.rs:215:16
567 |
568 215 | foo::<i16>(x_f64);
569 | ^^^^^ expected i16, found f64
570
571 error[E0308]: mismatched types
572 --> $DIR/numeric-cast.rs:217:16
573 |
574 217 | foo::<i16>(x_f32);
575 | ^^^^^ expected i16, found f32
576
577 error[E0308]: mismatched types
578 --> $DIR/numeric-cast.rs:220:15
579 |
580 220 | foo::<u8>(x_usize);
581 | ^^^^^^^ expected u8, found usize
582
583 error[E0308]: mismatched types
584 --> $DIR/numeric-cast.rs:222:15
585 |
586 222 | foo::<u8>(x_u64);
587 | ^^^^^ expected u8, found u64
588
589 error[E0308]: mismatched types
590 --> $DIR/numeric-cast.rs:224:15
591 |
592 224 | foo::<u8>(x_u32);
593 | ^^^^^ expected u8, found u32
594
595 error[E0308]: mismatched types
596 --> $DIR/numeric-cast.rs:226:15
597 |
598 226 | foo::<u8>(x_u16);
599 | ^^^^^ expected u8, found u16
600
601 error[E0308]: mismatched types
602 --> $DIR/numeric-cast.rs:229:15
603 |
604 229 | foo::<u8>(x_isize);
605 | ^^^^^^^ expected u8, found isize
606
607 error[E0308]: mismatched types
608 --> $DIR/numeric-cast.rs:231:15
609 |
610 231 | foo::<u8>(x_i64);
611 | ^^^^^ expected u8, found i64
612
613 error[E0308]: mismatched types
614 --> $DIR/numeric-cast.rs:233:15
615 |
616 233 | foo::<u8>(x_i32);
617 | ^^^^^ expected u8, found i32
618
619 error[E0308]: mismatched types
620 --> $DIR/numeric-cast.rs:235:15
621 |
622 235 | foo::<u8>(x_i16);
623 | ^^^^^ expected u8, found i16
624
625 error[E0308]: mismatched types
626 --> $DIR/numeric-cast.rs:237:15
627 |
628 237 | foo::<u8>(x_i8);
629 | ^^^^ expected u8, found i8
630
631 error[E0308]: mismatched types
632 --> $DIR/numeric-cast.rs:239:15
633 |
634 239 | foo::<u8>(x_f64);
635 | ^^^^^ expected u8, found f64
636
637 error[E0308]: mismatched types
638 --> $DIR/numeric-cast.rs:241:15
639 |
640 241 | foo::<u8>(x_f32);
641 | ^^^^^ expected u8, found f32
642
643 error[E0308]: mismatched types
644 --> $DIR/numeric-cast.rs:244:15
645 |
646 244 | foo::<i8>(x_usize);
647 | ^^^^^^^ expected i8, found usize
648
649 error[E0308]: mismatched types
650 --> $DIR/numeric-cast.rs:246:15
651 |
652 246 | foo::<i8>(x_u64);
653 | ^^^^^ expected i8, found u64
654
655 error[E0308]: mismatched types
656 --> $DIR/numeric-cast.rs:248:15
657 |
658 248 | foo::<i8>(x_u32);
659 | ^^^^^ expected i8, found u32
660
661 error[E0308]: mismatched types
662 --> $DIR/numeric-cast.rs:250:15
663 |
664 250 | foo::<i8>(x_u16);
665 | ^^^^^ expected i8, found u16
666
667 error[E0308]: mismatched types
668 --> $DIR/numeric-cast.rs:252:15
669 |
670 252 | foo::<i8>(x_u8);
671 | ^^^^ expected i8, found u8
672
673 error[E0308]: mismatched types
674 --> $DIR/numeric-cast.rs:254:15
675 |
676 254 | foo::<i8>(x_isize);
677 | ^^^^^^^ expected i8, found isize
678
679 error[E0308]: mismatched types
680 --> $DIR/numeric-cast.rs:256:15
681 |
682 256 | foo::<i8>(x_i64);
683 | ^^^^^ expected i8, found i64
684
685 error[E0308]: mismatched types
686 --> $DIR/numeric-cast.rs:258:15
687 |
688 258 | foo::<i8>(x_i32);
689 | ^^^^^ expected i8, found i32
690
691 error[E0308]: mismatched types
692 --> $DIR/numeric-cast.rs:260:15
693 |
694 260 | foo::<i8>(x_i16);
695 | ^^^^^ expected i8, found i16
696
697 error[E0308]: mismatched types
698 --> $DIR/numeric-cast.rs:263:15
699 |
700 263 | foo::<i8>(x_f64);
701 | ^^^^^ expected i8, found f64
702
703 error[E0308]: mismatched types
704 --> $DIR/numeric-cast.rs:265:15
705 |
706 265 | foo::<i8>(x_f32);
707 | ^^^^^ expected i8, found f32
708
709 error[E0308]: mismatched types
710 --> $DIR/numeric-cast.rs:268:16
711 |
712 268 | foo::<f64>(x_usize);
713 | ^^^^^^^ expected f64, found usize
714
715 error[E0308]: mismatched types
716 --> $DIR/numeric-cast.rs:270:16
717 |
718 270 | foo::<f64>(x_u64);
719 | ^^^^^ expected f64, found u64
720
721 error[E0308]: mismatched types
722 --> $DIR/numeric-cast.rs:272:16
723 |
724 272 | foo::<f64>(x_u32);
725 | ^^^^^ expected f64, found u32
726 help: you can cast an `u32` to `f64`, producing the floating point representation of the integer
727 |
728 272 | foo::<f64>(x_u32.into());
729 | ^^^^^^^^^^^^
730
731 error[E0308]: mismatched types
732 --> $DIR/numeric-cast.rs:274:16
733 |
734 274 | foo::<f64>(x_u16);
735 | ^^^^^ expected f64, found u16
736 help: you can cast an `u16` to `f64`, producing the floating point representation of the integer
737 |
738 274 | foo::<f64>(x_u16.into());
739 | ^^^^^^^^^^^^
740
741 error[E0308]: mismatched types
742 --> $DIR/numeric-cast.rs:276:16
743 |
744 276 | foo::<f64>(x_u8);
745 | ^^^^ expected f64, found u8
746 help: you can cast an `u8` to `f64`, producing the floating point representation of the integer
747 |
748 276 | foo::<f64>(x_u8.into());
749 | ^^^^^^^^^^^
750
751 error[E0308]: mismatched types
752 --> $DIR/numeric-cast.rs:278:16
753 |
754 278 | foo::<f64>(x_isize);
755 | ^^^^^^^ expected f64, found isize
756
757 error[E0308]: mismatched types
758 --> $DIR/numeric-cast.rs:280:16
759 |
760 280 | foo::<f64>(x_i64);
761 | ^^^^^ expected f64, found i64
762
763 error[E0308]: mismatched types
764 --> $DIR/numeric-cast.rs:282:16
765 |
766 282 | foo::<f64>(x_i32);
767 | ^^^^^ expected f64, found i32
768 help: you can cast an `i32` to `f64`, producing the floating point representation of the integer
769 |
770 282 | foo::<f64>(x_i32.into());
771 | ^^^^^^^^^^^^
772
773 error[E0308]: mismatched types
774 --> $DIR/numeric-cast.rs:284:16
775 |
776 284 | foo::<f64>(x_i16);
777 | ^^^^^ expected f64, found i16
778 help: you can cast an `i16` to `f64`, producing the floating point representation of the integer
779 |
780 284 | foo::<f64>(x_i16.into());
781 | ^^^^^^^^^^^^
782
783 error[E0308]: mismatched types
784 --> $DIR/numeric-cast.rs:286:16
785 |
786 286 | foo::<f64>(x_i8);
787 | ^^^^ expected f64, found i8
788 help: you can cast an `i8` to `f64`, producing the floating point representation of the integer
789 |
790 286 | foo::<f64>(x_i8.into());
791 | ^^^^^^^^^^^
792
793 error[E0308]: mismatched types
794 --> $DIR/numeric-cast.rs:289:16
795 |
796 289 | foo::<f64>(x_f32);
797 | ^^^^^ expected f64, found f32
798 help: you can cast an `f32` to `f64` in a lossless way
799 |
800 289 | foo::<f64>(x_f32.into());
801 | ^^^^^^^^^^^^
802
803 error[E0308]: mismatched types
804 --> $DIR/numeric-cast.rs:292:16
805 |
806 292 | foo::<f32>(x_usize);
807 | ^^^^^^^ expected f32, found usize
808
809 error[E0308]: mismatched types
810 --> $DIR/numeric-cast.rs:294:16
811 |
812 294 | foo::<f32>(x_u64);
813 | ^^^^^ expected f32, found u64
814
815 error[E0308]: mismatched types
816 --> $DIR/numeric-cast.rs:296:16
817 |
818 296 | foo::<f32>(x_u32);
819 | ^^^^^ expected f32, found u32
820
821 error[E0308]: mismatched types
822 --> $DIR/numeric-cast.rs:298:16
823 |
824 298 | foo::<f32>(x_u16);
825 | ^^^^^ expected f32, found u16
826 help: you can cast an `u16` to `f32`, producing the floating point representation of the integer
827 |
828 298 | foo::<f32>(x_u16.into());
829 | ^^^^^^^^^^^^
830
831 error[E0308]: mismatched types
832 --> $DIR/numeric-cast.rs:300:16
833 |
834 300 | foo::<f32>(x_u8);
835 | ^^^^ expected f32, found u8
836 help: you can cast an `u8` to `f32`, producing the floating point representation of the integer
837 |
838 300 | foo::<f32>(x_u8.into());
839 | ^^^^^^^^^^^
840
841 error[E0308]: mismatched types
842 --> $DIR/numeric-cast.rs:302:16
843 |
844 302 | foo::<f32>(x_isize);
845 | ^^^^^^^ expected f32, found isize
846
847 error[E0308]: mismatched types
848 --> $DIR/numeric-cast.rs:304:16
849 |
850 304 | foo::<f32>(x_i64);
851 | ^^^^^ expected f32, found i64
852
853 error[E0308]: mismatched types
854 --> $DIR/numeric-cast.rs:306:16
855 |
856 306 | foo::<f32>(x_i32);
857 | ^^^^^ expected f32, found i32
858
859 error[E0308]: mismatched types
860 --> $DIR/numeric-cast.rs:308:16
861 |
862 308 | foo::<f32>(x_i16);
863 | ^^^^^ expected f32, found i16
864 help: you can cast an `i16` to `f32`, producing the floating point representation of the integer
865 |
866 308 | foo::<f32>(x_i16.into());
867 | ^^^^^^^^^^^^
868
869 error[E0308]: mismatched types
870 --> $DIR/numeric-cast.rs:310:16
871 |
872 310 | foo::<f32>(x_i8);
873 | ^^^^ expected f32, found i8
874 help: you can cast an `i8` to `f32`, producing the floating point representation of the integer
875 |
876 310 | foo::<f32>(x_i8.into());
877 | ^^^^^^^^^^^
878
879 error[E0308]: mismatched types
880 --> $DIR/numeric-cast.rs:312:16
881 |
882 312 | foo::<f32>(x_f64);
883 | ^^^^^ expected f32, found f64
884
885 error[E0308]: mismatched types
886 --> $DIR/numeric-cast.rs:316:16
887 |
888 316 | foo::<u32>(x_u8 as u16);
889 | ^^^^^^^^^^^ expected u32, found u16
890 help: you can cast an `u16` to `u32`, which will zero-extend the source value
891 |
892 316 | foo::<u32>((x_u8 as u16).into());
893 | ^^^^^^^^^^^^^^^^^^^^
894
895 error[E0308]: mismatched types
896 --> $DIR/numeric-cast.rs:318:16
897 |
898 318 | foo::<i32>(-x_i8);
899 | ^^^^^ expected i32, found i8
900 help: you can cast an `i8` to `i32`, which will sign-extend the source value
901 |
902 318 | foo::<i32>((-x_i8).into());
903 | ^^^^^^^^^^^^^^
904
905 error: aborting due to 134 previous errors
906