Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions src/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,34 @@ Language changes in Rust 1.91.0
- `Stabilize declaration of C-style variadic functions for 'sysv64', 'win64', 'efiapi', and 'aapcs' ABIs <https://github.com/rust-lang/rust/pull/144066>`_.
This brings these ABIs in line with the C ABI: variadic functions can be declared in extern blocks but not defined.

- Changed paragraphs:

- :p:`fls_hbn1l42xmr3h`
- :p:`fls_dbbfqaqa80r8`
- :p:`fls_icdzs1mjh0n4`

- New paragraphs:

- :p:`fls_OR85NVifPwjr`
- :p:`fls_4s2IdfYDzPrX`
- :p:`fls_ZJJppPfiJRou`
- :p:`fls_jOyZh9ujWWHQ`
- :p:`fls_Xdr0bFwxhWiB`
- :p:`fls_DpTFEHZAABdD`
- :p:`fls_6urL6fZ5cpaA`
- :p:`fls_TMOzb6cYIOlH`
- :p:`fls_eHPWHrvs7ETl`
- :p:`fls_mjCrvmikm58M`
- :p:`fls_4EUb9zFatZ97`
- :p:`fls_4B4B5FIqAes9`
- :p:`fls_b7FTlWfnX2OI`
- :p:`fls_o4uSLPo00KUg`
- :p:`fls_UippZpUyYpHl`
- :p:`fls_CIyK8BYzzo26`
- :p:`fls_ccFdnlX5HIYk`
- :p:`fls_xrCRprWS13R1`
- :p:`fls_JHlqXjn4Sf07`

- `Add dangling_pointers_from_locals lint to warn against dangling pointers from local variables <https://github.com/rust-lang/rust/pull/144322>`_

- No change: lints are not part of the FLS
Expand Down
24 changes: 21 additions & 3 deletions src/ffi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ The following :t:`[ABI]s` are supported:
:dt:`Rust ABI`.

* :dp:`fls_8m7pc3riokst`
``extern "system"`` - The operating system-dependent :t:`ABI`, referred to as
:dt:`external system ABI`.
``extern "system"`` - The operating system-dependent :t:`ABI`.

* :dp:`fls_NQAzj5ai1La5`
``extern "system-unwind"`` - The same as ``extern "system"`` with the
Expand All @@ -96,11 +95,19 @@ A tool is allowed to specify additional :t:`[ABI]s`. These :t:`[ABI]s` may
include, but may not be limited to, the following:

* :dp:`fls_dbbfqaqa80r8`
``extern "aapcs"`` - The ARM :t:`ABI`.
``extern "aapcs"`` - The soft-float ABI for 32-bit ARM targets.

* :dp:`fls_UippZpUyYpHl`
``extern "aapcs-unwind"`` - The same as ``extern "aapcs"``
with the addition that unwinding across FFI is permitted.

* :dp:`fls_36qrs2fxxvi7`
``extern "cdecl"`` - The x86_32 :t:`ABI` of :t:`C` code.

* :dp:`fls_CIyK8BYzzo26`
``extern "cdecl-unwind"`` - The same as ``extern "cdecl"``
with the addition that unwinding across FFI is permitted.

* :dp:`fls_6rtj6rwqxojh`
``extern "fastcall"`` - The ``fastcall`` :t:`ABI` that corresponds to MSVC's
``__fastcall`` and GCC and clang's ``__attribute__((fastcall))``.
Expand All @@ -111,13 +118,24 @@ include, but may not be limited to, the following:
* :dp:`fls_7t7yxh94wnbl`
``extern "sysv64"`` - The x86_64 non-Windows :t:`ABI` of :t:`C` code.

* :dp:`fls_ccFdnlX5HIYk`
``extern "sysv64-unwind"`` - The same as ``extern "sysv64"``
with the addition that unwinding across FFI is permitted.

* :dp:`fls_sxj4vy39sj4g`
``extern "vectorcall"`` - The ``vectorcall`` :t:`ABI` that corresponds to
MSVC's ``__vectorcall`` and clang's ``__attribute__((vectorcall))``.

* :dp:`fls_tyjs1x4j8ovp`
``extern "win64"`` - The x86_64 Windows :t:`ABI` of :t:`C` code.

* :dp:`fls_xrCRprWS13R1`
``extern "win64-unwind"`` - The same as ``extern "win64"``
with the addition that unwinding across FFI is permitted.

* :dp:`fls_JHlqXjn4Sf07`
``extern "efiapi"`` - The :t:`ABI` for `UEFI <https://uefi.org/specifications>`_.

.. rubric:: Undefined Behavior

:dp:`fls_M4LqHf8hbPA8`
Expand Down
34 changes: 32 additions & 2 deletions src/functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,39 @@ The :t:`expected type` of the :t:`pattern` of a :t:`function parameter` is the :
:dp:`fls_PGDKWK7nPvgw`
The :t:`[binding]s` of all :t:`[pattern]s` of all :t:`[function parameter]s` of a :t:`function` shall not shadow another.

:dp:`fls_o4uSLPo00KUg`
A :dt:`variadic function` is an :t:`external function` that specifies
:s:`FunctionParameterVariadicPart` as the last :t:`function parameter`.

:dp:`fls_icdzs1mjh0n4`
A :t:`function` shall not specify a :s:`FunctionParameterVariadicPart` unless
it is an :t:`external function`.
A :t:`variadic function` shall specify one of the following :t:`[ABI]s`:

* :dp:`fls_OR85NVifPwjr`
``extern "C"``
* :dp:`fls_4s2IdfYDzPrX`
``extern "C-unwind"``
* :dp:`fls_ZJJppPfiJRou`
``extern "aapcs"``
* :dp:`fls_jOyZh9ujWWHQ`
``extern "aapcs-unwind"``
* :dp:`fls_Xdr0bFwxhWiB`
``extern "cdecl"``
* :dp:`fls_DpTFEHZAABdD`
``extern "cdecl-unwind"``
* :dp:`fls_b7FTlWfnX2OI`
``extern "efiapi"``
* :dp:`fls_6urL6fZ5cpaA`
``extern "system"``
* :dp:`fls_TMOzb6cYIOlH`
``extern "system-unwind"``
* :dp:`fls_eHPWHrvs7ETl`
``extern "sysv64"``
* :dp:`fls_mjCrvmikm58M`
``extern "sysv64-unwind"``
* :dp:`fls_4EUb9zFatZ97`
``extern "win64"``
* :dp:`fls_4B4B5FIqAes9`
``extern "win64-unwind"``

:dp:`fls_vljy4mm0zca2`
A :t:`return type` is the :t:`type` of the result a :t:`function`, :t:`closure type` or :t:`function pointer type` returns.
Expand Down
3 changes: 1 addition & 2 deletions src/types-and-traits.rst
Original file line number Diff line number Diff line change
Expand Up @@ -978,8 +978,7 @@ A :t:`variadic part` indicates the presence of :t:`C`-like optional
parameters.

:dp:`fls_hbn1l42xmr3h`
A :t:`variadic part` shall be specified only when the :t:`ABI` of the
:t:`function pointer type` is either ``extern "C"`` or ``extern "cdecl"``.
A :t:`variadic part` can only be used in a :t:`variadic function`.

:dp:`fls_g1iYVw7upBnH`
The :t:`return type` of a :t:`function pointer type` is determined as follows:
Expand Down