Skip to content

Commit b4ab93e

Browse files
Merge #500
500: Update to 1.79 r=pietroalbini a=Veykril Builds on top of #499 Co-authored-by: Lukas Wirth <[email protected]>
2 parents f0e299f + 6874aa7 commit b4ab93e

9 files changed

+216
-60
lines changed

src/attributes.rst

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ Built-in Attributes
122122
AutomaticallyDerivedContent
123123
| CfgAttrContent
124124
| CfgContent
125+
| CollapseDebuginfoContent
125126
| ColdContent
126127
| CrateNameContent
127128
| CrateTypeContent
@@ -1240,7 +1241,7 @@ Attribute ``no_main``
12401241

12411242
:dp:`fls_6qig3s3qpj0i`
12421243
:t:`Attribute` :dc:`no_main` indicates that the symbols of the
1243-
:t:`main function` will not be present in a binary.
1244+
:t:`program entry point` will not be present in a binary.
12441245

12451246
.. rubric:: Examples
12461247

@@ -1449,6 +1450,42 @@ Attribute ``type_length_limit``
14491450
Macros Attributes
14501451
~~~~~~~~~~~~~~~~~
14511452

1453+
.. _fls_qyudjGHZfyJH:
1454+
1455+
Attribute ``collapse_debuginfo``
1456+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1457+
1458+
.. rubric:: Syntax
1459+
1460+
.. syntax::
1461+
1462+
CollapseDebuginfoContent ::=
1463+
$$collapse_debuginfo$$ $$($$ CollapseDebuginfoKind $$)$$
1464+
CollapseDebuginfoKind ::=
1465+
$$no
1466+
| $$external$$
1467+
| $$yes$$
1468+
1469+
.. rubric:: Legality Rules
1470+
1471+
:dp:`fls_EzKHtWHmXMAZ`
1472+
:t:`Attribute` :c:`collapse_debuginfo` shall apply to :t:`[declarative macro]s`.
1473+
1474+
:dp:`fls_BCvJpfQMYEcD`
1475+
:t:`Attribute` :dc:`collapse_debuginfo` changes the debug location information
1476+
for the expanded code of the :t:`declarative macro` to its invocation site. This
1477+
repeats recursively to the top most expansion of a :t:`declarative macro` that
1478+
is not annotated with :t:`attribute` :c:`collapse_debuginfo`.
1479+
1480+
.. rubric:: Examples
1481+
1482+
.. code-block:: rust
1483+
1484+
#[collapse_debuginfo(yes)]
1485+
macro_rules! m {
1486+
() => {};
1487+
}
1488+
14521489
.. _fls_e0a96eb6ux3y:
14531490

14541491
Attribute ``macro_export``

src/entities-and-resolution.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,10 @@ related :t:`let statement` appears.
496496
The :t:`binding` of a :t:`match arm` is :t:`in scope` within its related
497497
:t:`[expression]s` and related :t:`match arm guard`.
498498

499+
:dp:`fls_eBacCVlDaKYK`
500+
A :t:`binding` declared outside of a :t:`const block expression` is not :t:`in
501+
scope` within such a :t:`const block expression`.
502+
499503
.. _fls_ftphlagzd2te:
500504

501505
Generic Parameter Scope

src/expressions.rst

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Expressions
2020
OuterAttributeOrDoc* (
2121
AsyncBlockExpression
2222
| BlockExpression
23+
| ConstBlockExpression
2324
| IfExpression
2425
| IfLetExpression
2526
| LoopExpression
@@ -316,6 +317,9 @@ A :t:`constant context` is a :t:`construct` that requires a
316317
* :dp:`fls_ib8p7dfwddx2`
317318
The :t:`static initializer` of a :t:`static`.
318319

320+
* :dp:`fls_ucFupTeCyylb`
321+
The :t:`block expression` of a :t:`const block expression`.
322+
319323
:dp:`fls_ox6sgl9n43g2`
320324
It is a static error to create a :t:`mutable reference` in a
321325
:t:`constant context`.
@@ -784,6 +788,48 @@ the :t:`[capture target]s` of the :t:`async block expression`.
784788
42
785789
}
786790
791+
.. _fls_G59PiNQkVUnQ:
792+
793+
Const Blocks
794+
~~~~~~~~~~~~
795+
796+
.. rubric:: Syntax
797+
798+
.. syntax::
799+
800+
ConstBlockExpression ::=
801+
$$const$$ BlockExpression
802+
803+
.. rubric:: Legality Rules
804+
805+
:dp:`fls_0lcunL4bo8ka`
806+
A :t:`const block expression` is a :t:`block expression` that is specified
807+
with :t:`keyword` ``const`` and encapsulates behavior which is evaluated
808+
statically.
809+
810+
:dp:`fls_veEGzEbpT4ny`
811+
An :t:`const block expression` denotes a new :t:`control flow boundary`.
812+
813+
:dp:`fls_PiUS1hF3dv9U`
814+
The :t:`block expression` of a :t:`const block expression` shall be a
815+
:t:`constant expression`.
816+
817+
:dp:`fls_wuwb0SnpP6Zu`
818+
The :t:`type` of a :t:`const block expression` is the :t:`type` of the
819+
containing :t:`block expression`.
820+
821+
:dp:`fls_2i7TD7VoQk4B`
822+
The :t:`value` of a :t:`const block expression` is the :t:`value` of the
823+
contained :t:`block expression`.
824+
825+
.. rubric:: Examples
826+
827+
.. code-block:: rust
828+
829+
const {
830+
42
831+
}
832+
787833
.. _fls_0ybsR1hEo7wV:
788834

789835
Named Blocks

src/functions.rst

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -176,34 +176,6 @@ An :t:`unsafe function` is a :t:`function` subject to :t:`keyword` ``unsafe``.
176176
:dp:`fls_5hn8fkf7rcvz`
177177
The invocation of an :t:`unsafe function` shall require :t:`unsafe context`.
178178

179-
:dp:`fls_nw49shkqx40b`
180-
A :t:`main function` is a :t:`function` that acts as an entry point into a
181-
program. A :t:`main function` is subject to the following restrictions:
182-
183-
* :dp:`fls_o4fxok23134r`
184-
It lacks :t:`[function qualifier]s` ``async`` and ``unsafe``,
185-
186-
* :dp:`fls_bk755pvc1l53`
187-
Its :t:`ABI` is Rust,
188-
189-
* :dp:`fls_5j2vbkt2hitj`
190-
Its :t:`name` is the word ``main``,
191-
192-
* :dp:`fls_a3je4wc53bmo`
193-
It lacks :t:`[generic parameter]s`,
194-
195-
* :dp:`fls_w8q15zp7kyl0`
196-
It lacks :t:`[function parameter]s`,
197-
198-
* :dp:`fls_4psnfphsgdek`
199-
It lacks a :t:`return type`,
200-
201-
* :dp:`fls_m7xfrhqif74`
202-
It lacks a :t:`where clause`,
203-
204-
* :dp:`fls_qq9fzrw4aykd`
205-
It has a :t:`function body`.
206-
207179
.. rubric:: Examples
208180

209181
.. code-block:: rust

src/general.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,8 @@ external interactions:
238238
passed to it;
239239

240240
* :dp:`fls_3iekobt8qqi`
241-
Any result returned or :t:`panic` propagated from a :t:`main function` or an
242-
:t:`exported function` to an external caller;
241+
Any result returned or :t:`panic` propagated from a :t:`program entry point`
242+
or an :t:`exported function` to an external caller;
243243

244244
* :dp:`fls_qx9fxf4py0j0`
245245
The imported and exported :t:`[value]s` at the time of any other interaction

src/generics.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,13 +311,17 @@ Generic Arguments
311311

312312
GenericArgument ::=
313313
BindingArgument
314+
| BindingBoundArgument
314315
| ConstantArgument
315316
| LifetimeArgument
316317
| TypeArgument
317318
318319
BindingArgument ::=
319320
Identifier $$=$$ TypeSpecification
320321

322+
BindingBoundArgument ::=
323+
Identifier $$:$$ TypeBoundList
324+
321325
ConstantArgument ::=
322326
BlockExpression
323327
| $$-$$? LiteralExpression
@@ -349,6 +353,16 @@ A :s:`LifetimeArgument` shall precede :s:`[BindingArgument]s`,
349353
A :t:`binding argument` is a :t:`generic argument` that supplies the :t:`type`
350354
of an :t:`associated trait type`.
351355

356+
:dp:`fls_mcUMWsYcxzmZ`
357+
A :t:`binding bound argument` is a :t:`generic argument` that further imposes
358+
:t:`[bound]s` on an :t:`associated trait type`.
359+
360+
:dp:`fls_dxMfAI4EZVS5`
361+
A :t:`binding bound argument` shall only be used within the confines of a
362+
:t:`type bound predicate`'s :t:`[bound]s`, :t:`[impl trait type]`'s
363+
:t:`[bound]s`, :t:`associated type`'s :t:`[bound]s` or :t:`trait`'s
364+
:t:`[supertrait]s`.
365+
352366
:dp:`fls_i3z9ueoe99zd`
353367
A :t:`constant argument` is a :t:`generic argument` that supplies the
354368
:t:`value` of a :t:`constant parameter`.

src/glossary.rst

Lines changed: 37 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ binary crate
655655
^^^^^^^^^^^^
656656

657657
:dp:`fls_8gfe7hajxkd7`
658-
A :dt:`binary crate` is a :t:`crate` that contains a :t:`main function`.
658+
A :dt:`binary crate` is a :t:`crate` whose :t:`crate type` is ``bin``.
659659

660660
.. _fls_or4o65fyt28y:
661661

@@ -697,6 +697,15 @@ binding argument
697697
A :dt:`binding argument` is a :t:`generic argument` that supplies the :t:`type`
698698
of an :t:`associated trait type`.
699699

700+
.. _fls_t2cit5QOte8U:
701+
702+
binding bound argument
703+
^^^^^^^^^^^^^^^^^^^^^^
704+
705+
:dp:`fls_D3i3n4RIReCA`
706+
A :dt:`binding bound argument` is a :t:`generic argument` that further imposes
707+
:t:`[bound]s` on an :t:`associated trait type`.
708+
700709
.. _fls_bv1k866tai6j:
701710

702711
binding mode
@@ -1557,6 +1566,16 @@ crate root module
15571566
A :dt:`crate root module` is the root of the nested :t:`module` tree of a
15581567
:t:`crate`.
15591568

1569+
.. _fls_lVpE4uFDsXH4:
1570+
1571+
crate type
1572+
^^^^^^^^^^
1573+
1574+
:dp:`fls_eaxsgPMFNH7f`
1575+
The :dt:`crate type` of a :t:`crate` is the value of the :t:`attribute`
1576+
``crate_type`` of a :t:`crate` or the value of ``--crate-type`` flag passed to
1577+
the tool compiling the :t:`crate`.
1578+
15601579
.. _fls_76cj65bptdpn:
15611580

15621581
dangling
@@ -3715,15 +3734,6 @@ lexical element
37153734
A :dt:`lexical element` is the most basic syntactic element in program
37163735
text.
37173736

3718-
.. _fls_r1sk7vdgckym:
3719-
3720-
library crate
3721-
^^^^^^^^^^^^^
3722-
3723-
:dp:`fls_3m8lg4mdc2x0`
3724-
A :dt:`library crate` is either a :t:`crate` without a :t:`main function` or a
3725-
:t:`crate` subject to :t:`attribute` :c:`no_main`.
3726-
37273737
.. _fls_vdhaa61g6kah:
37283738

37293739
lifetime
@@ -4058,14 +4068,14 @@ macro transcription
40584068
:dt:`Macro transcription` is the process of producing the expansion of a
40594069
:t:`declarative macro`.
40604070

4061-
.. _fls_dz192n9muwpg:
4071+
.. _fls_MJ1YWiOpxAa8:
40624072

4063-
main function
4064-
^^^^^^^^^^^^^
4073+
main function signature
4074+
^^^^^^^^^^^^^^^^^^^^^^^
40654075

4066-
:dp:`fls_au3ovrkenr59`
4067-
A :dt:`main function` is a :t:`function` that acts as an entry point into
4068-
a program.
4076+
:dp:`fls_QijObGZEIykU`
4077+
A :dt:`main function signature` is a :t:`function signature` subject to specific
4078+
restrictions.
40694079

40704080
.. _fls_fizf1byuspv2:
40714081

@@ -5055,7 +5065,7 @@ proc-macro crate
50555065
.. _fls_AjjdLZWiL9Tq:
50565066

50575067
:dp:`fls_DfTszT1PjV7o`
5058-
A :dt:`proc-macro crate` is a :t:`crate` that contains :t:`[procedural macro]s`.
5068+
A :t:`proc-macro crate` is a :t:`crate` whose :t:`crate type` is ``proc-macro``.
50595069

50605070
.. _fls_sp5wdsxwmxf:
50615071

@@ -5066,6 +5076,15 @@ procedural macro
50665076
A :dt:`procedural macro` is a :t:`macro` that encapsulates syntactic
50675077
transformations in a :t:`function`.
50685078

5079+
.. _fls_SIFecOZqloyx:
5080+
5081+
program entry point
5082+
^^^^^^^^^^^^^^^^^^^
5083+
5084+
:dp:`fls_9m37hN9zgEQf`
5085+
A :dt:`program entry point` is a :t:`function` that is invoked at the start of
5086+
a Rust program.
5087+
50695088
.. _fls_v2rjlovqsdyr:
50705089

50715090
public visibility
@@ -5188,7 +5207,7 @@ A :dt:`range pattern` is a :t:`pattern` that matches :t:`[value]s` which fall
51885207
within a range.
51895208

51905209
:dp:`fls_r36uf3y2denr`
5191-
See ``RangePattern.``
5210+
See ``RangePattern``.
51925211

51935212
.. _fls_3ls9xlgt8ei1:
51945213

src/ownership-and-deconstruction.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,18 @@ An :dt:`extending expression` is either
625625
:t:`array expression`, a :t:`borrow expression`, a :t:`struct expression`, a
626626
:t:`tuple expression`, or a :t:`type cast expression`, or
627627

628+
* :dp:`fls_Rj9zhVutfQod`
629+
The :t:`block expression` and :t:`else expression` of an :t:`if expression`
630+
that is an :t:`extending expression`.
631+
632+
* :dp:`fls_oodpp3LpXC13`
633+
The :t:`expression` of an :t:`else expression` that is an :t:`extending
634+
expression`.
635+
636+
* :dp:`fls_xGThCPoTUSAi`
637+
The :t:`expression` of a :t:`match arm` of a :t:`match expression` that is an
638+
:t:`extending expression`.
639+
628640
* :dp:`fls_iqw0d1l1lj3i`
629641
The :t:`tail expression` of a :t:`block expression` that is an
630642
:t:`extending expression`.

0 commit comments

Comments
 (0)