Commit 29b3739
authored
Rollup merge of rust-lang#70487 - Mark-Simulacrum:float-unchecked-casts, r=SimonSapin
Stabilize float::to_int_unchecked
This renames and stabilizes unsafe floating point to integer casts, which are intended to be the substitute for the currently unsound `as` behavior, once that changes to safe-but-slower saturating casts. As such, I believe this also likely unblocks rust-lang#10184 (our oldest I-unsound issue!), as once this rolls out to stable it would be far easier IMO to change the behavior of `as` to be safe by default.
This does not stabilize the trait or the associated method, as they are deemed internal implementation details (and consumers should not, generally, want to expose them, as in practice all callers likely know statically/without generics what the return type is).
Closes rust-lang#67058File tree
6 files changed
+33
-22
lines changed- src
- libcore
- convert
- num
- librustc_codegen_llvm
- librustc_typeck/check
6 files changed
+33
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
32 | 39 | | |
33 | 40 | | |
34 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1582 | 1582 | | |
1583 | 1583 | | |
1584 | 1584 | | |
| 1585 | + | |
1585 | 1586 | | |
1586 | 1587 | | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + | |
| 1592 | + | |
| 1593 | + | |
| 1594 | + | |
1587 | 1595 | | |
1588 | 1596 | | |
1589 | 1597 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
464 | 464 | | |
465 | 465 | | |
466 | 466 | | |
467 | | - | |
468 | | - | |
469 | 467 | | |
470 | | - | |
| 468 | + | |
471 | 469 | | |
472 | 470 | | |
473 | 471 | | |
474 | | - | |
| 472 | + | |
475 | 473 | | |
476 | 474 | | |
477 | 475 | | |
| |||
482 | 480 | | |
483 | 481 | | |
484 | 482 | | |
485 | | - | |
| 483 | + | |
486 | 484 | | |
487 | | - | |
| 485 | + | |
488 | 486 | | |
489 | 487 | | |
490 | 488 | | |
491 | | - | |
| 489 | + | |
492 | 490 | | |
493 | 491 | | |
494 | 492 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
478 | 478 | | |
479 | 479 | | |
480 | 480 | | |
481 | | - | |
482 | | - | |
483 | 481 | | |
484 | | - | |
| 482 | + | |
485 | 483 | | |
486 | 484 | | |
487 | 485 | | |
488 | | - | |
| 486 | + | |
489 | 487 | | |
490 | 488 | | |
491 | 489 | | |
| |||
496 | 494 | | |
497 | 495 | | |
498 | 496 | | |
499 | | - | |
| 497 | + | |
500 | 498 | | |
501 | | - | |
| 499 | + | |
502 | 500 | | |
503 | 501 | | |
504 | 502 | | |
505 | | - | |
| 503 | + | |
506 | 504 | | |
507 | 505 | | |
508 | 506 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
543 | 543 | | |
544 | 544 | | |
545 | 545 | | |
546 | | - | |
| 546 | + | |
547 | 547 | | |
548 | 548 | | |
549 | 549 | | |
550 | 550 | | |
551 | 551 | | |
552 | | - | |
| 552 | + | |
553 | 553 | | |
554 | 554 | | |
555 | 555 | | |
| |||
570 | 570 | | |
571 | 571 | | |
572 | 572 | | |
573 | | - | |
| 573 | + | |
574 | 574 | | |
575 | 575 | | |
576 | 576 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
275 | 275 | | |
276 | 276 | | |
277 | 277 | | |
278 | | - | |
| 278 | + | |
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
| |||
0 commit comments