diff --git a/src/changelog.rst b/src/changelog.rst index eee2fab7..ede01209 100644 --- a/src/changelog.rst +++ b/src/changelog.rst @@ -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 `_. 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 `_ - No change: lints are not part of the FLS diff --git a/src/ffi.rst b/src/ffi.rst index 95725dfb..7ab1b6d3 100644 --- a/src/ffi.rst +++ b/src/ffi.rst @@ -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 @@ -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))``. @@ -111,6 +118,10 @@ 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))``. @@ -118,6 +129,13 @@ include, but may not be limited to, the following: * :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 `_. + .. rubric:: Undefined Behavior :dp:`fls_M4LqHf8hbPA8` diff --git a/src/functions.rst b/src/functions.rst index e7822952..3a5e02c2 100644 --- a/src/functions.rst +++ b/src/functions.rst @@ -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. diff --git a/src/types-and-traits.rst b/src/types-and-traits.rst index 870181b2..593d7440 100644 --- a/src/types-and-traits.rst +++ b/src/types-and-traits.rst @@ -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: