Skip to content

Commit 7912518

Browse files
committed
Specify the target limits for target-specific ABIs
This specifies the restrictions on which targets specific ABIs are available. These are defined in `rustc` in [`is_abi_supported`](https://github.com/rust-lang/rust/blob/eec6bd9d69832f57341c6de6a93fa7b9f47e2111/compiler/rustc_target/src/spec/mod.rs#L2610-L2613) and the associated `AbiMap`. Some of these are currently only implemented as future-incompatible warnings via `unsupported_calling_conventions`. I'm fine with just not acknowledging that, and saying what the intent is. This is split off from rust-lang#1948 with the intent of separating out the changes.
1 parent d01f991 commit 7912518

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

src/items/external-blocks.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -130,30 +130,38 @@ r[items.extern.abi.platform]
130130
There are also some platform-specific ABI strings:
131131

132132
r[items.extern.abi.cdecl]
133-
* `unsafe extern "cdecl"` -- The default for x86\_32 C code.
133+
* `unsafe extern "cdecl"` -- The default for x86_32 C code.
134+
* Only available on x86_32 targets.
134135

135136
r[items.extern.abi.stdcall]
136-
* `unsafe extern "stdcall"` -- The default for the Win32 API on x86\_32.
137+
* `unsafe extern "stdcall"` -- The default for the Win32 API on x86_32.
138+
* Only available on x86_32 targets.
137139

138140
r[items.extern.abi.win64]
139-
* `unsafe extern "win64"` -- The default for C code on x86\_64 Windows.
141+
* `unsafe extern "win64"` -- The default for C code on x86_64 Windows.
142+
* Only available on x86_64 targets.
140143

141144
r[items.extern.abi.sysv64]
142-
* `unsafe extern "sysv64"` -- The default for C code on non-Windows x86\_64.
145+
* `unsafe extern "sysv64"` -- The default for C code on non-Windows x86_64.
146+
* Only available on x86_64 targets.
143147

144148
r[items.extern.abi.aapcs]
145149
* `unsafe extern "aapcs"` -- The default for ARM.
150+
* Only available on ARM32 targets.
146151

147152
r[items.extern.abi.fastcall]
148153
* `unsafe extern "fastcall"` -- The `fastcall` ABI -- corresponds to MSVC's
149-
`__fastcall` and GCC and clang's `__attribute__((fastcall))`
154+
`__fastcall` and GCC and clang's `__attribute__((fastcall))`.
155+
* Only available on x86_32 targets.
150156

151157
r[items.extern.abi.thiscall]
152-
* `unsafe extern "thiscall"` -- The default for C++ member functions on x86\_32 MSVC -- corresponds to MSVC's
153-
`__thiscall` and GCC and clang's `__attribute__((thiscall))`
158+
* `unsafe extern "thiscall"` -- The default for C++ member functions on x86_32 MSVC -- corresponds to MSVC's
159+
`__thiscall` and GCC and clang's `__attribute__((thiscall))`.
160+
* Only available on x86_32 targets.
154161

155162
r[items.extern.abi.efiapi]
156163
* `unsafe extern "efiapi"` -- The ABI used for [UEFI] functions.
164+
* Only available on x86 and ARM targets (32bit and 64bit).
157165

158166
r[items.extern.abi.platform-unwind-variants]
159167
Like `"C"` and `"system"`, most platform-specific ABI strings also have a [corresponding `-unwind` variant][unwind-behavior]; specifically, these are:

0 commit comments

Comments
 (0)