Commit 000ccd6
committed
Auto merge of #148766 - cjgillot:mir-const-runtime-checks, r=RalfJung,saethlin
Replace Rvalue::NullaryOp by a variant in mir::Operand.
Based on #148151
This PR fully removes the MIR `Rvalue::NullaryOp`. After #148151, it was only useful for runtime checks like `ub_checks`, `contract_checks` and `overflow_checks`.
These are "runtime" checks, boolean constants that may only be `true` in codegen. It depends on a rustc flag passed to codegen, so we need to represent those flags cross-crate.
This PR replaces those runtime checks by special variants in MIR `ConstValue`. This allows code that expects constants to manipulate those as such, even if we may not always be able to evaluate them to actual scalars.File tree
65 files changed
+1095
-401
lines changed- compiler
- rustc_borrowck/src
- diagnostics
- polonius/legacy
- type_check
- rustc_codegen_cranelift/src
- rustc_codegen_ssa/src/mir
- rustc_const_eval/src
- check_consts
- const_eval
- interpret
- rustc_middle/src
- mir
- ty
- rustc_mir_build/src/builder
- custom
- rustc_mir_dataflow/src
- impls
- move_paths
- rustc_mir_transform/src
- rustc_public/src
- mir
- unstable/convert/stable
- library/core/src
- src/tools/clippy/clippy_utils/src
- mir
- tests
- codegen-llvm/lib-optimizations
- mir-opt
- const_prop
- inline
- instsimplify
- ui-fulldeps/rustc_public
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
65 files changed
+1095
-401
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
764 | 764 | | |
765 | 765 | | |
766 | 766 | | |
| 767 | + | |
767 | 768 | | |
768 | 769 | | |
769 | 770 | | |
| |||
809 | 810 | | |
810 | 811 | | |
811 | 812 | | |
| 813 | + | |
812 | 814 | | |
813 | 815 | | |
814 | 816 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1559 | 1559 | | |
1560 | 1560 | | |
1561 | 1561 | | |
1562 | | - | |
1563 | | - | |
1564 | | - | |
1565 | | - | |
1566 | 1562 | | |
1567 | 1563 | | |
1568 | 1564 | | |
| |||
1699 | 1695 | | |
1700 | 1696 | | |
1701 | 1697 | | |
1702 | | - | |
| 1698 | + | |
1703 | 1699 | | |
1704 | 1700 | | |
1705 | 1701 | | |
| |||
1750 | 1746 | | |
1751 | 1747 | | |
1752 | 1748 | | |
1753 | | - | |
| 1749 | + | |
1754 | 1750 | | |
1755 | 1751 | | |
1756 | 1752 | | |
| |||
Lines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
250 | | - | |
| 250 | + | |
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
| |||
314 | 314 | | |
315 | 315 | | |
316 | 316 | | |
317 | | - | |
318 | | - | |
319 | 317 | | |
320 | 318 | | |
321 | 319 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1023 | 1023 | | |
1024 | 1024 | | |
1025 | 1025 | | |
1026 | | - | |
| 1026 | + | |
1027 | 1027 | | |
1028 | 1028 | | |
1029 | 1029 | | |
| |||
1046 | 1046 | | |
1047 | 1047 | | |
1048 | 1048 | | |
1049 | | - | |
1050 | | - | |
1051 | 1049 | | |
1052 | 1050 | | |
1053 | 1051 | | |
| |||
2276 | 2274 | | |
2277 | 2275 | | |
2278 | 2276 | | |
2279 | | - | |
2280 | 2277 | | |
2281 | 2278 | | |
2282 | 2279 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
853 | 853 | | |
854 | 854 | | |
855 | 855 | | |
856 | | - | |
857 | | - | |
858 | | - | |
859 | | - | |
860 | | - | |
861 | | - | |
862 | | - | |
863 | | - | |
864 | | - | |
865 | | - | |
866 | | - | |
867 | 856 | | |
868 | 857 | | |
869 | 858 | | |
| |||
1050 | 1039 | | |
1051 | 1040 | | |
1052 | 1041 | | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
1053 | 1047 | | |
1054 | 1048 | | |
1055 | 1049 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
540 | 540 | | |
541 | 541 | | |
542 | 542 | | |
| 543 | + | |
543 | 544 | | |
544 | 545 | | |
545 | 546 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1056 | 1056 | | |
1057 | 1057 | | |
1058 | 1058 | | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
1059 | 1070 | | |
1060 | 1071 | | |
1061 | 1072 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
619 | 619 | | |
620 | 620 | | |
621 | 621 | | |
622 | | - | |
623 | | - | |
624 | | - | |
625 | | - | |
626 | | - | |
627 | | - | |
628 | | - | |
629 | | - | |
630 | | - | |
631 | | - | |
632 | | - | |
633 | | - | |
634 | | - | |
635 | | - | |
636 | | - | |
637 | 622 | | |
638 | 623 | | |
639 | 624 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
645 | 645 | | |
646 | 646 | | |
647 | 647 | | |
648 | | - | |
649 | 648 | | |
650 | 649 | | |
651 | 650 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
233 | | - | |
234 | | - | |
235 | | - | |
| 233 | + | |
236 | 234 | | |
237 | 235 | | |
238 | 236 | | |
| |||
340 | 338 | | |
341 | 339 | | |
342 | 340 | | |
| 341 | + | |
343 | 342 | | |
344 | 343 | | |
345 | 344 | | |
| |||
0 commit comments