Skip to content

Commit

Permalink
Specify default abi for extern blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
Veykril committed Nov 16, 2023
1 parent 496ef38 commit cd10556
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/ffi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ External Blocks
.. syntax::

ExternalBlock ::=
$$unsafe$$? $$extern$$ AbiSpecification? $${$$
$$unsafe$$? $$extern$$ AbiKind? $${$$
InnerAttributeOrDoc*
ExternItem*
$$}$$
Expand All @@ -158,6 +158,15 @@ External Blocks
An :t:`external block` is a :t:`construct` that provides the declarations of
foreign :t:`[function]s` as unchecked imports.

:dp:`fls_Nz0l16hMxqTd`
The :t:`ABI` of a :t:`extern block` is determined as follows:

* :dp:`fls_4XOoiFloXM7t`
If the :t:`extern block` specifies an :s:`AbiKind`, then the :t:`ABI` is the specified :s:`AbiKind`.

* :dp:`fls_PBsepNHImJKH`
Otherwise the :t:`ABI` is the :t:`extern C ABI`.

:dp:`fls_iaimuqcclstl`
The ``unsafe`` :t:`keyword` of an :t:`external block` is rejected, but may
still be consumed by :t:`[macro]s`.
Expand Down Expand Up @@ -237,4 +246,3 @@ An :t:`external static` shall not specify a :t:`static initializer`.
:dp:`fls_en2h09ehj0j3`
An :t:`immutable` :t:`external static` shall be initialized before Rust code
is executed.

0 comments on commit cd10556

Please sign in to comment.