This repository was archived by the owner on May 28, 2025. It is now read-only.
Commit 754d171
committed
Auto merge of rust-lang#85195 - Mark-Simulacrum:variant-by-idx, r=petrochenkov
Store VariantIdx to distinguish enum variants
This saves ~24% of the instructions on the match-stress-enum benchmark, but I'm not 100% sure that this is OK - if we ever compare two constructors across enums (e.g., a Result and an Option), then this is obviously insufficient; I can experiment with continuing to store the DefId for comparison purposes in that case.File tree
1 file changed
+7
-10
lines changed- compiler/rustc_mir_build/src/thir/pattern
1 file changed
+7
-10
lines changedLines changed: 7 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | 55 | | |
57 | 56 | | |
58 | 57 | | |
| |||
590 | 589 | | |
591 | 590 | | |
592 | 591 | | |
593 | | - | |
| 592 | + | |
594 | 593 | | |
595 | 594 | | |
596 | 595 | | |
| |||
634 | 633 | | |
635 | 634 | | |
636 | 635 | | |
637 | | - | |
| 636 | + | |
638 | 637 | | |
639 | 638 | | |
640 | 639 | | |
| |||
649 | 648 | | |
650 | 649 | | |
651 | 650 | | |
652 | | - | |
653 | | - | |
654 | | - | |
| 651 | + | |
655 | 652 | | |
656 | 653 | | |
657 | 654 | | |
| |||
928 | 925 | | |
929 | 926 | | |
930 | 927 | | |
931 | | - | |
932 | | - | |
| 928 | + | |
| 929 | + | |
933 | 930 | | |
934 | 931 | | |
935 | 932 | | |
936 | | - | |
| 933 | + | |
937 | 934 | | |
938 | 935 | | |
939 | | - | |
| 936 | + | |
940 | 937 | | |
941 | 938 | | |
942 | 939 | | |
| |||
0 commit comments