This repository was archived by the owner on May 28, 2025. It is now read-only.
Commit adb3631
committed
Auto merge of rust-lang#128784 - tdittr:check-abi-on-fn-ptr, r=<try>
Check ABI target compatibility for function pointers
Related tracking issue: rust-lang#87678
Compatibility of an ABI for a target was previously only performed on function definitions and `extern` blocks. This PR adds it also to function pointers to be consistent.
This might have broken some of the `tests/ui/` depending on the platform, so a try run seems like a good idea.
Also this might break existing code, because we now emit extra errors. Does this require a crater run?
# Example
```rust
// build with: --target=x86_64-unknown-linux-gnu
// These raise E0570
extern "thiscall" fn foo() {}
extern "thiscall" { fn bar() }
// This did not raise any error
fn baz(f: extern "thiscall" fn()) { f() }
```
try-job: aarch64-gnu
try-job: aarch64-apple
try-job: x86_64-msvc
try-job: x86_64-mingw
try-job: i686-msvc
try-job: i686-mingw
try-job: test-various
try-job: armhf-gnuFile tree
17 files changed
+765
-81
lines changed- compiler/rustc_hir_analysis/src
- check
- hir_ty_lowering
- tests/ui
- abi
- c-variadic
- cmse-nonsecure/cmse-nonsecure-call
17 files changed
+765
-81
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | 54 | | |
66 | 55 | | |
67 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
| 1 | + | |
| 2 | + | |
4 | 3 | | |
5 | 4 | | |
6 | 5 | | |
| |||
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
29 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
30 | 41 | | |
31 | 42 | | |
32 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2309 | 2309 | | |
2310 | 2310 | | |
2311 | 2311 | | |
| 2312 | + | |
| 2313 | + | |
| 2314 | + | |
| 2315 | + | |
| 2316 | + | |
| 2317 | + | |
2312 | 2318 | | |
2313 | 2319 | | |
2314 | 2320 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 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 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
3 | 106 | | |
4 | 107 | | |
5 | 108 | | |
6 | 109 | | |
7 | 110 | | |
8 | | - | |
| 111 | + | |
9 | 112 | | |
10 | 113 | | |
11 | 114 | | |
12 | 115 | | |
13 | 116 | | |
14 | | - | |
| 117 | + | |
15 | 118 | | |
16 | 119 | | |
17 | 120 | | |
18 | 121 | | |
19 | 122 | | |
20 | | - | |
| 123 | + | |
21 | 124 | | |
22 | 125 | | |
23 | 126 | | |
24 | 127 | | |
25 | 128 | | |
26 | | - | |
| 129 | + | |
27 | 130 | | |
28 | 131 | | |
29 | 132 | | |
30 | 133 | | |
31 | 134 | | |
32 | | - | |
| 135 | + | |
33 | 136 | | |
34 | 137 | | |
35 | 138 | | |
36 | 139 | | |
37 | 140 | | |
38 | | - | |
| 141 | + | |
39 | 142 | | |
40 | 143 | | |
41 | 144 | | |
42 | 145 | | |
43 | 146 | | |
44 | | - | |
| 147 | + | |
45 | 148 | | |
46 | 149 | | |
47 | 150 | | |
48 | 151 | | |
49 | 152 | | |
50 | 153 | | |
51 | | - | |
52 | 154 | | |
53 | | - | |
| 155 | + | |
54 | 156 | | |
55 | 157 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 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 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
3 | 94 | | |
4 | 95 | | |
5 | 96 | | |
6 | 97 | | |
7 | 98 | | |
8 | | - | |
| 99 | + | |
9 | 100 | | |
10 | 101 | | |
11 | 102 | | |
12 | 103 | | |
13 | 104 | | |
14 | | - | |
| 105 | + | |
15 | 106 | | |
16 | 107 | | |
17 | 108 | | |
18 | 109 | | |
19 | 110 | | |
20 | | - | |
| 111 | + | |
21 | 112 | | |
22 | 113 | | |
23 | 114 | | |
24 | 115 | | |
25 | 116 | | |
26 | | - | |
| 117 | + | |
27 | 118 | | |
28 | 119 | | |
29 | 120 | | |
30 | 121 | | |
31 | 122 | | |
32 | | - | |
| 123 | + | |
33 | 124 | | |
34 | 125 | | |
35 | 126 | | |
36 | 127 | | |
37 | 128 | | |
38 | | - | |
| 129 | + | |
39 | 130 | | |
40 | 131 | | |
41 | 132 | | |
42 | 133 | | |
43 | 134 | | |
44 | 135 | | |
45 | | - | |
46 | 136 | | |
47 | | - | |
| 137 | + | |
48 | 138 | | |
49 | 139 | | |
0 commit comments