Skip to content

Commit 9024a89

Browse files
authored
Merge pull request #574 from ferrocene/tshepang/document-1.88
document Rust 1.88 changes
2 parents 9e16912 + 10edc58 commit 9024a89

File tree

3 files changed

+167
-16
lines changed

3 files changed

+167
-16
lines changed

src/attributes.rst

Lines changed: 67 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ Built-in Attributes
138138
| LinkOrdinalContent
139139
| MacroExportContent
140140
| MacroUseContent
141+
| NakedContent
141142
| NoBinutilsContent
142143
| NoImplicitPreludeContent
143144
| NoLinkContent
@@ -184,6 +185,9 @@ The following :t:`[built-in attribute]s` are :dt:`[code generation attribute]s`:
184185
* :dp:`fls_gxxbf6eag3et`
185186
:t:`Attribute` :c:`track_caller`.
186187

188+
* :dp:`fls_eOJS3mxa9xgu`
189+
:t:`Attribute` :c:`naked`.
190+
187191
:dp:`fls_87o6n9et9jio`
188192
The following :t:`[built-in attribute]s` are
189193
:dt:`[conditional compilation attribute]s`:
@@ -682,6 +686,48 @@ the :t:`attribute`.
682686
#[track_caller]
683687
fn who_called_me () {}
684688
689+
690+
.. _fls_Sd6rUmpEb355:
691+
692+
Attribute ``naked``
693+
^^^^^^^^^^^^^^^^^^^
694+
695+
.. rubric:: Syntax
696+
697+
.. syntax::
698+
699+
NakedContent ::=
700+
$$naked$$
701+
702+
.. rubric:: Legality Rules
703+
704+
:dp:`fls_8eg0iN2diBZt`
705+
:t:`Attribute` :c:`naked` shall apply to :t:`[function]s`.
706+
707+
:dp:`fls_WnqgR5OyecIs`
708+
:t:`Attribute` :dc:`naked` ensures that a :t:`function` prologue and epilogue are not generated.
709+
710+
:dp:`fls_NCHa4Dc1M6oM`
711+
:t:`Attribute` :c:`naked` :t:`function body` must consist of exactly one
712+
:t:`macro` :std:`core::arch::naked_asm` call.
713+
714+
:dp:`fls_H7ccwNk2HGAi`
715+
:t:`Attribute` :c:`naked` cannot be used together with :t:`[testing function]s`.
716+
717+
:dp:`fls_ocOk47SGiRVb`
718+
:t:`Attribute` :c:`naked` cannot be used together with :t:`attribute` :c:`inline`.
719+
720+
:dp:`fls_VUL2qySBvRqy`
721+
:t:`Attribute` :c:`naked` cannot be used together with :t:`attribute` :c:`track_caller`.
722+
723+
.. rubric:: Undefined Behavior
724+
725+
:dp:`fls_0tYMAQY1V55p`
726+
It is a :t:`safety invariant` for the :t:`function body` to respect the :t:`ABI` of the function.
727+
728+
:dp:`fls_wGbJrz4OpKKb`
729+
It is a :t:`safety invariant` for the :t:`function body` to :t:`diverge <diverging expression>`.
730+
685731
.. _fls_cdx9zb1yxcc8:
686732

687733
Conditional Compilation Attributes
@@ -704,6 +750,8 @@ Attribute ``cfg``
704750
| ConfigurationPredicateAll
705751
| ConfigurationPredicateAny
706752
| ConfigurationPredicateNot
753+
| $$true$$
754+
| $$false$$
707755
708756
ConfigurationOption ::=
709757
ConfigurationOptionName ConfigurationOptionValue?
@@ -760,6 +808,12 @@ negates the Boolean :t:`value` of its nested :t:`configuration predicate`.
760808
A :t:`not configuration predicate` evaluates statically to ``true`` when its
761809
nested configuration predicate evaluates to ``false``.
762810

811+
:dp:`fls_JWx8vQwl19Fu`
812+
:t:`Configuration predicate` :dc:`true` always evaluates statically to ``true``.
813+
814+
:dp:`fls_SziFAQsio0ab`
815+
:t:`Configuration predicate` :dc:`false` always evaluates statically to ``false``.
816+
763817
:dp:`fls_jbl9xyynjo0g`
764818
The :t:`evaluation` of a configuration option is tool-defined.
765819

@@ -1378,23 +1432,29 @@ Attribute ``unsafe``
13781432

13791433
.. rubric:: Legality Rules
13801434

1435+
:dp:`fls_z5DTDKM9mU3o`
1436+
:t:`Attribute` :dc:`unsafe` is used to indicate that an :t:`attribute` is :t:`unsafe <unsafe operation>`.
1437+
13811438
:dp:`fls_5pjo3nGOxbVw`
13821439
:t:`Attribute` :c:`unsafe` shall apply to what the contained :t:`attribute` applies to.
13831440

13841441
:dp:`fls_gpxlWbQUNsj8`
1385-
:t:`Attribute` :c:`unsafe` behaves like the contained :t:`attribute`.
1442+
:t:`Attribute` :c:`unsafe` does not affect the behavior of the contained :t:`attribute`.
13861443

13871444
:dp:`fls_PhrfxSBvXTPV`
1388-
The contained :t:`attribute` shall be one of:
1445+
The contained :t:`attribute` shall be one of the following:
13891446

13901447
* :dp:`fls_pCSew95bKJJ5`
1391-
:t:`attribute` :c:`no_mangle`,
1448+
:t:`Attribute` :c:`no_mangle`
1449+
1450+
* :dp:`fls_NRLgmOXxuljQ`
1451+
:t:`Attribute` :c:`export_name`
13921452

1393-
:dp:`fls_NRLgmOXxuljQ`
1394-
:t:`attribute` :c:`export_name`, or
1453+
* :dp:`fls_ykpxNByUDyHG`
1454+
:t:`Attribute` :c:`link_section`
13951455

1396-
:dp:`fls_ykpxNByUDyHG`
1397-
:t:`attribute` :c:`link_section`,
1456+
* :dp:`fls_2oP2nbDPtUg7`
1457+
:t:`Attribute` :c:`naked`
13981458

13991459
.. rubric:: Examples
14001460

src/changelog.rst

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,75 @@ with the change that has been applied due to it.
1818
just the language changes that had an impact to the FLS. See the `release
1919
notes`_ for a full list of changes.
2020

21+
Language changes in Rust 1.88.0
22+
-------------------------------
23+
24+
- `Stabilize let_chains feature in the 2024 edition <https://github.com/rust-lang/rust/pull/132833>`_
25+
26+
- No change: the FLS only supports the 2021 edition
27+
28+
- `Stabilize naked_functions feature <https://github.com/rust-lang/rust/pull/134213>`_
29+
30+
- New sections: :ref:`fls_Sd6rUmpEb355`
31+
32+
- New paragraphs:
33+
34+
- :p:`fls_eOJS3mxa9xgu`
35+
36+
- :p:`fls_2oP2nbDPtUg7`
37+
38+
- :p:`fls_y2wCBvXDtQK2`
39+
40+
- :p:`fls_PEoOGTBjuEQc`
41+
42+
- :p:`fls_vcB5xwgD6Ign`
43+
44+
- Changed paragraphs:
45+
46+
- :p:`fls_3fg60jblx0xb`
47+
48+
- :p:`fls_ecteot716j8j`
49+
50+
- :p:`fls_tgzga1lanfuo`
51+
52+
- :p:`fls_g09kmp2a04g9`
53+
54+
- :p:`fls_nszx1gllufi2`
55+
56+
- New syntax: :s:`SymPathExpression`
57+
58+
- Changed syntax:
59+
60+
- :s:`RegisterArgument`
61+
62+
- :s:`RegisterExpression`
63+
64+
- :s:`BuiltinAttributeContent`
65+
66+
- `Stabilize cfg_boolean_literals feature <https://github.com/rust-lang/rust/pull/138632>`_
67+
68+
- Changed syntax: :s:`ConfigurationPredicate`
69+
70+
- `Fully de-stabilize the #[bench] attribute <https://github.com/rust-lang/rust/pull/134273)>`_
71+
72+
- No change: this was an unstable feature and was therefore not specified in the FLS
73+
74+
- `Add warn-by-default dangerous_implicit_autorefs lint against implicit autoref of raw pointer dereference <https://github.com/rust-lang/rust/pull/123239>`_
75+
76+
- No change: lints are not part of the FLS
77+
78+
- `Add invalid_null_arguments lint to prevent invalid usage of null pointers <https://github.com/rust-lang/rust/pull/119220>`_
79+
80+
- No change: lints are not part of the FLS
81+
82+
- `Change trait impl candidate preference for builtin impls and trivial where-clauses. <https://github.com/rust-lang/rust/pull/138176>`_
83+
84+
- No change: trait impl candidate preference is not specified in the FLS
85+
86+
- `Check types of generic const parameter defaults <https://github.com/rust-lang/rust/pull/139646>`_
87+
88+
- No change: this bug was not documented in the FLS
89+
2190
Language changes in Rust 1.87.0
2291
-------------------------------
2392

src/inline-assembly.rst

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ Rust program.
1818

1919
:dp:`fls_3fg60jblx0xb`
2020
:t:`Inline assembly` is written as an :t:`assembly code block` that is
21-
wrapped inside a :t:`macro invocation` of :t:`macro` :std:`core::arch::asm` or
22-
:t:`macro` :std:`core::arch::global_asm`.
21+
wrapped inside a :t:`macro invocation` of
22+
:t:`macro` :std:`core::arch::asm`,
23+
:t:`macro` :std:`core::arch::global_asm`, or
24+
:t:`macro` :std:`core::arch::naked_asm`.
2325

2426
:dp:`fls_helnk2iz8qhp`
2527
:t:`Inline assembly` is available on the following architectures:
@@ -604,7 +606,7 @@ Register Arguments
604606
.. syntax::
605607

606608
RegisterArgument ::=
607-
(Identifier $$=$$)? DirectionModifier $$($$ RegisterName $$)$$ RegisterExpression
609+
(Identifier $$=$$)? ( DirectionModifier $$($$ RegisterName $$)$$ )? RegisterExpression
608610

609611
DirectionModifier ::=
610612
$$in$$
@@ -617,6 +619,7 @@ Register Arguments
617619
InputOutputRegisterExpression
618620
| SimpleRegisterExpression
619621
| ConstRegisterExpression
622+
| SymPathExpression
620623
621624
InputOutputRegisterExpression ::=
622625
InputRegisterExpression $$=>$$ OutputRegisterExpression
@@ -635,6 +638,9 @@ Register Arguments
635638
ConstRegisterExpression ::=
636639
$$const$$ Expression
637640

641+
SymPathExpression ::=
642+
$$sym$$ PathExpression
643+
638644
.. rubric:: Legality Rules
639645

640646
:dp:`fls_455dmnp4cxqv`
@@ -703,6 +709,10 @@ A :t:`register expression` is either an :t:`input-output register expression`, a
703709
:dp:`fls_jU8zg4k8dFsY`
704710
The :t:`type` of a :t:`const register expression` shall be an :t:`integer type`.
705711

712+
:dp:`fls_y2wCBvXDtQK2`
713+
A :dt:`sym path expression` is a way for the :t:`assembly code block` to refer either to
714+
a :t:`function` :t:`name` or a :t:`static` :t:`name`.
715+
706716
:dp:`fls_66owmltvhnu4`
707717
The :t:`type` of an :t:`input register expression`,
708718
:t:`output register expression`, or :t:`simple register expression` shall
@@ -1484,7 +1494,7 @@ An :t:`assembly option` is used to specify a characteristic of or a restriction
14841494
on the related :t:`assembly code block`.
14851495

14861496
:dp:`fls_g09kmp2a04g9`
1487-
:t:`Assembly option` ``att_syntax`` is applicable only to x86 architectures
1497+
:t:`Assembly option` :dc:`att_syntax` is applicable only to x86 architectures
14881498
and causes the assembler to use the ``.att_syntax`` prefix mode which prefixes
14891499
:t:`[register]s` with ``%``.
14901500

@@ -1561,7 +1571,7 @@ of the following flags :t:`[register]s` shall be restored on exit from an
15611571
side effects, and its outputs depend only on direct inputs.
15621572

15631573
:dp:`fls_nszx1gllufi2`
1564-
:t:`Assembly option` ``raw`` causes :t:`[assembly instruction]s` to be parsed
1574+
:t:`Assembly option` :dc:`raw` causes :t:`[assembly instruction]s` to be parsed
15651575
raw, without any special handling of :t:`[register parameter]s`.
15661576

15671577
:dp:`fls_d169ppna563c`
@@ -1607,8 +1617,8 @@ It is undefined behavior if control reaches the end of an
16071617
16081618
.. _fls_qezwyridmjob:
16091619

1610-
Macros asm and global_asm
1611-
-------------------------
1620+
Macros: asm, global_asm, and naked_asm
1621+
--------------------------------------
16121622

16131623
.. rubric:: Syntax
16141624

@@ -1627,7 +1637,9 @@ Macros asm and global_asm
16271637

16281638
:dp:`fls_ecteot716j8j`
16291639
:t:`[Assembly code block]s` are embedded within Rust source code using
1630-
:t:`[macro]s` :std:`core::arch::asm` and :std:`core::arch::global_asm`.
1640+
:t:`[macro]s` :std:`core::arch::asm`,
1641+
:std:`core::arch::global_asm`, and
1642+
:std:`core::arch::naked_asm`.
16311643

16321644
:dp:`fls_1ikzov7cxic1`
16331645
When invoking :t:`macro` :std:`core::arch::asm`, the :s:`DelimitedTokenTree` of
@@ -1641,7 +1653,8 @@ encapsulate the :t:`assembly code block` in a separate :t:`function` and
16411653
generate a :t:`call expression` to it.
16421654

16431655
:dp:`fls_tgzga1lanfuo`
1644-
When invoking :t:`macro` :std:`core::arch::global_asm`, the
1656+
When invoking :t:`macro` :std:`core::arch::global_asm` and
1657+
:t:`macro` :std:`core::arch::naked_asm`, the
16451658
:s:`DelimitedTokenTree` of the related :t:`macro invocation` shall follow the
16461659
syntax of :s:`GlobalAsmArguments`.
16471660

@@ -1650,6 +1663,15 @@ Invoking :t:`macro` :std:`core::arch::global_asm` causes the related
16501663
:t:`assembly code block` to be emitted outside the :t:`function` where the
16511664
:t:`macro invocation` took place.
16521665

1666+
:dp:`fls_PEoOGTBjuEQc`
1667+
The only :t:`[register argument]s` that can be used with :t:`[macro]s`
1668+
:std:`core::arch::global_asm` and :std:`core::arch::naked_asm` are
1669+
:t:`const <const register expression>` and :t:`sym <sym path expression>`.
1670+
1671+
:dp:`fls_vcB5xwgD6Ign`
1672+
The only :t:`[assembly option]s` that can be used with :t:`[macro]s`
1673+
:std:`core::arch::global_asm` and :std:`core::arch::naked_asm` are :c:`att_syntax` and :c:`raw`.
1674+
16531675
.. rubric:: Dynamic Semantics
16541676

16551677
:dp:`fls_98vyqh9bzigx`

0 commit comments

Comments
 (0)