Commit 7a202a9
committed
Auto merge of rust-lang#135204 - RalfJung:win64-zst, r=SparrowLii
fix handling of ZST in win64 ABI on windows-msvc targets
The Microsoft calling conventions do not really say anything about ZST since they do not seem to exist in MSVC. However, both GCC and clang allow passing ZST over `__attribute__((ms_abi))` functions (which matches our `extern "win64" fn`) on `windows-gnu` targets, and therefore implicitly define a de-facto ABI for these types (and lucky enough they seem to define the same ABI). This ABI should be the same for windows-msvc and windows-gnu targets, so we use this as a hint for how to implement this ABI everywhere: we always pass ZST by-ref.
The best alternative would be to just reject compiling functions which cannot exist in MSVC, but that would be a breaking change.
Cc `@programmerjake` `@ChrisDenton`
Fixes rust-lang#132893File tree
9 files changed
+91
-271
lines changed- compiler
- rustc_abi/src/extern_abi
- rustc_target/src
- callconv
- spec
- tests
- codegen
- ui/abi
9 files changed
+91
-271
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
195 | 199 | | |
196 | 200 | | |
197 | 201 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
| 12 | + | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
| |||
627 | 626 | | |
628 | 627 | | |
629 | 628 | | |
630 | | - | |
| 629 | + | |
631 | 630 | | |
632 | 631 | | |
633 | 632 | | |
634 | 633 | | |
635 | 634 | | |
636 | 635 | | |
637 | | - | |
| 636 | + | |
638 | 637 | | |
639 | 638 | | |
640 | 639 | | |
641 | 640 | | |
642 | 641 | | |
643 | | - | |
| 642 | + | |
644 | 643 | | |
645 | 644 | | |
646 | 645 | | |
| |||
651 | 650 | | |
652 | 651 | | |
653 | 652 | | |
654 | | - | |
| 653 | + | |
655 | 654 | | |
656 | 655 | | |
657 | | - | |
658 | | - | |
659 | | - | |
| 656 | + | |
660 | 657 | | |
661 | 658 | | |
662 | 659 | | |
| |||
666 | 663 | | |
667 | 664 | | |
668 | 665 | | |
669 | | - | |
670 | | - | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
671 | 670 | | |
672 | 671 | | |
673 | 672 | | |
| |||
701 | 700 | | |
702 | 701 | | |
703 | 702 | | |
704 | | - | |
| 703 | + | |
705 | 704 | | |
706 | 705 | | |
707 | 706 | | |
| |||
730 | 729 | | |
731 | 730 | | |
732 | 731 | | |
733 | | - | |
| 732 | + | |
734 | 733 | | |
735 | 734 | | |
736 | 735 | | |
| |||
821 | 820 | | |
822 | 821 | | |
823 | 822 | | |
824 | | - | |
| 823 | + | |
825 | 824 | | |
826 | 825 | | |
827 | 826 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
51 | 50 | | |
52 | 51 | | |
53 | 52 | | |
54 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
55 | 57 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2815 | 2815 | | |
2816 | 2816 | | |
2817 | 2817 | | |
2818 | | - | |
2819 | | - | |
2820 | | - | |
2821 | | - | |
| 2818 | + | |
| 2819 | + | |
| 2820 | + | |
| 2821 | + | |
| 2822 | + | |
| 2823 | + | |
2822 | 2824 | | |
2823 | | - | |
| 2825 | + | |
| 2826 | + | |
| 2827 | + | |
| 2828 | + | |
2824 | 2829 | | |
2825 | 2830 | | |
2826 | 2831 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
This file was deleted.
This file was deleted.
This file was deleted.
0 commit comments