Skip to content

Commit

Permalink
Merge #500
Browse files Browse the repository at this point in the history
500: Update to 1.79 r=pietroalbini a=Veykril

Builds on top of #499 

Co-authored-by: Lukas Wirth <[email protected]>
  • Loading branch information
bors-ferrocene[bot] and Veykril authored Jul 3, 2024
2 parents f0e299f + 6874aa7 commit b4ab93e
Show file tree
Hide file tree
Showing 9 changed files with 216 additions and 60 deletions.
39 changes: 38 additions & 1 deletion src/attributes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ Built-in Attributes
AutomaticallyDerivedContent
| CfgAttrContent
| CfgContent
| CollapseDebuginfoContent
| ColdContent
| CrateNameContent
| CrateTypeContent
Expand Down Expand Up @@ -1240,7 +1241,7 @@ Attribute ``no_main``

:dp:`fls_6qig3s3qpj0i`
:t:`Attribute` :dc:`no_main` indicates that the symbols of the
:t:`main function` will not be present in a binary.
:t:`program entry point` will not be present in a binary.

.. rubric:: Examples

Expand Down Expand Up @@ -1449,6 +1450,42 @@ Attribute ``type_length_limit``
Macros Attributes
~~~~~~~~~~~~~~~~~

.. _fls_qyudjGHZfyJH:

Attribute ``collapse_debuginfo``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. rubric:: Syntax

.. syntax::

CollapseDebuginfoContent ::=
$$collapse_debuginfo$$ $$($$ CollapseDebuginfoKind $$)$$
CollapseDebuginfoKind ::=
$$no
| $$external$$
| $$yes$$
.. rubric:: Legality Rules

:dp:`fls_EzKHtWHmXMAZ`
:t:`Attribute` :c:`collapse_debuginfo` shall apply to :t:`[declarative macro]s`.

:dp:`fls_BCvJpfQMYEcD`
:t:`Attribute` :dc:`collapse_debuginfo` changes the debug location information
for the expanded code of the :t:`declarative macro` to its invocation site. This
repeats recursively to the top most expansion of a :t:`declarative macro` that
is not annotated with :t:`attribute` :c:`collapse_debuginfo`.

.. rubric:: Examples

.. code-block:: rust
#[collapse_debuginfo(yes)]
macro_rules! m {
() => {};
}
.. _fls_e0a96eb6ux3y:

Attribute ``macro_export``
Expand Down
4 changes: 4 additions & 0 deletions src/entities-and-resolution.rst
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,10 @@ related :t:`let statement` appears.
The :t:`binding` of a :t:`match arm` is :t:`in scope` within its related
:t:`[expression]s` and related :t:`match arm guard`.

:dp:`fls_eBacCVlDaKYK`
A :t:`binding` declared outside of a :t:`const block expression` is not :t:`in
scope` within such a :t:`const block expression`.

.. _fls_ftphlagzd2te:

Generic Parameter Scope
Expand Down
46 changes: 46 additions & 0 deletions src/expressions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Expressions
OuterAttributeOrDoc* (
AsyncBlockExpression
| BlockExpression
| ConstBlockExpression
| IfExpression
| IfLetExpression
| LoopExpression
Expand Down Expand Up @@ -316,6 +317,9 @@ A :t:`constant context` is a :t:`construct` that requires a
* :dp:`fls_ib8p7dfwddx2`
The :t:`static initializer` of a :t:`static`.

* :dp:`fls_ucFupTeCyylb`
The :t:`block expression` of a :t:`const block expression`.

:dp:`fls_ox6sgl9n43g2`
It is a static error to create a :t:`mutable reference` in a
:t:`constant context`.
Expand Down Expand Up @@ -784,6 +788,48 @@ the :t:`[capture target]s` of the :t:`async block expression`.
42
}
.. _fls_G59PiNQkVUnQ:

Const Blocks
~~~~~~~~~~~~

.. rubric:: Syntax

.. syntax::

ConstBlockExpression ::=
$$const$$ BlockExpression

.. rubric:: Legality Rules

:dp:`fls_0lcunL4bo8ka`
A :t:`const block expression` is a :t:`block expression` that is specified
with :t:`keyword` ``const`` and encapsulates behavior which is evaluated
statically.

:dp:`fls_veEGzEbpT4ny`
An :t:`const block expression` denotes a new :t:`control flow boundary`.

:dp:`fls_PiUS1hF3dv9U`
The :t:`block expression` of a :t:`const block expression` shall be a
:t:`constant expression`.

:dp:`fls_wuwb0SnpP6Zu`
The :t:`type` of a :t:`const block expression` is the :t:`type` of the
containing :t:`block expression`.

:dp:`fls_2i7TD7VoQk4B`
The :t:`value` of a :t:`const block expression` is the :t:`value` of the
contained :t:`block expression`.

.. rubric:: Examples

.. code-block:: rust
const {
42
}
.. _fls_0ybsR1hEo7wV:

Named Blocks
Expand Down
28 changes: 0 additions & 28 deletions src/functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -176,34 +176,6 @@ An :t:`unsafe function` is a :t:`function` subject to :t:`keyword` ``unsafe``.
:dp:`fls_5hn8fkf7rcvz`
The invocation of an :t:`unsafe function` shall require :t:`unsafe context`.

:dp:`fls_nw49shkqx40b`
A :t:`main function` is a :t:`function` that acts as an entry point into a
program. A :t:`main function` is subject to the following restrictions:

* :dp:`fls_o4fxok23134r`
It lacks :t:`[function qualifier]s` ``async`` and ``unsafe``,

* :dp:`fls_bk755pvc1l53`
Its :t:`ABI` is Rust,

* :dp:`fls_5j2vbkt2hitj`
Its :t:`name` is the word ``main``,

* :dp:`fls_a3je4wc53bmo`
It lacks :t:`[generic parameter]s`,

* :dp:`fls_w8q15zp7kyl0`
It lacks :t:`[function parameter]s`,

* :dp:`fls_4psnfphsgdek`
It lacks a :t:`return type`,

* :dp:`fls_m7xfrhqif74`
It lacks a :t:`where clause`,

* :dp:`fls_qq9fzrw4aykd`
It has a :t:`function body`.

.. rubric:: Examples

.. code-block:: rust
Expand Down
4 changes: 2 additions & 2 deletions src/general.rst
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,8 @@ external interactions:
passed to it;

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

* :dp:`fls_qx9fxf4py0j0`
The imported and exported :t:`[value]s` at the time of any other interaction
Expand Down
14 changes: 14 additions & 0 deletions src/generics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -311,13 +311,17 @@ Generic Arguments

GenericArgument ::=
BindingArgument
| BindingBoundArgument
| ConstantArgument
| LifetimeArgument
| TypeArgument
BindingArgument ::=
Identifier $$=$$ TypeSpecification

BindingBoundArgument ::=
Identifier $$:$$ TypeBoundList

ConstantArgument ::=
BlockExpression
| $$-$$? LiteralExpression
Expand Down Expand Up @@ -349,6 +353,16 @@ A :s:`LifetimeArgument` shall precede :s:`[BindingArgument]s`,
A :t:`binding argument` is a :t:`generic argument` that supplies the :t:`type`
of an :t:`associated trait type`.

:dp:`fls_mcUMWsYcxzmZ`
A :t:`binding bound argument` is a :t:`generic argument` that further imposes
:t:`[bound]s` on an :t:`associated trait type`.

:dp:`fls_dxMfAI4EZVS5`
A :t:`binding bound argument` shall only be used within the confines of a
:t:`type bound predicate`'s :t:`[bound]s`, :t:`[impl trait type]`'s
:t:`[bound]s`, :t:`associated type`'s :t:`[bound]s` or :t:`trait`'s
:t:`[supertrait]s`.

:dp:`fls_i3z9ueoe99zd`
A :t:`constant argument` is a :t:`generic argument` that supplies the
:t:`value` of a :t:`constant parameter`.
Expand Down
55 changes: 37 additions & 18 deletions src/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ binary crate
^^^^^^^^^^^^

:dp:`fls_8gfe7hajxkd7`
A :dt:`binary crate` is a :t:`crate` that contains a :t:`main function`.
A :dt:`binary crate` is a :t:`crate` whose :t:`crate type` is ``bin``.

.. _fls_or4o65fyt28y:

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

.. _fls_t2cit5QOte8U:

binding bound argument
^^^^^^^^^^^^^^^^^^^^^^

:dp:`fls_D3i3n4RIReCA`
A :dt:`binding bound argument` is a :t:`generic argument` that further imposes
:t:`[bound]s` on an :t:`associated trait type`.

.. _fls_bv1k866tai6j:

binding mode
Expand Down Expand Up @@ -1557,6 +1566,16 @@ crate root module
A :dt:`crate root module` is the root of the nested :t:`module` tree of a
:t:`crate`.

.. _fls_lVpE4uFDsXH4:

crate type
^^^^^^^^^^

:dp:`fls_eaxsgPMFNH7f`
The :dt:`crate type` of a :t:`crate` is the value of the :t:`attribute`
``crate_type`` of a :t:`crate` or the value of ``--crate-type`` flag passed to
the tool compiling the :t:`crate`.

.. _fls_76cj65bptdpn:

dangling
Expand Down Expand Up @@ -3715,15 +3734,6 @@ lexical element
A :dt:`lexical element` is the most basic syntactic element in program
text.

.. _fls_r1sk7vdgckym:

library crate
^^^^^^^^^^^^^

:dp:`fls_3m8lg4mdc2x0`
A :dt:`library crate` is either a :t:`crate` without a :t:`main function` or a
:t:`crate` subject to :t:`attribute` :c:`no_main`.

.. _fls_vdhaa61g6kah:

lifetime
Expand Down Expand Up @@ -4058,14 +4068,14 @@ macro transcription
:dt:`Macro transcription` is the process of producing the expansion of a
:t:`declarative macro`.

.. _fls_dz192n9muwpg:
.. _fls_MJ1YWiOpxAa8:

main function
^^^^^^^^^^^^^
main function signature
^^^^^^^^^^^^^^^^^^^^^^^

:dp:`fls_au3ovrkenr59`
A :dt:`main function` is a :t:`function` that acts as an entry point into
a program.
:dp:`fls_QijObGZEIykU`
A :dt:`main function signature` is a :t:`function signature` subject to specific
restrictions.

.. _fls_fizf1byuspv2:

Expand Down Expand Up @@ -5055,7 +5065,7 @@ proc-macro crate
.. _fls_AjjdLZWiL9Tq:

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

.. _fls_sp5wdsxwmxf:

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

.. _fls_SIFecOZqloyx:

program entry point
^^^^^^^^^^^^^^^^^^^

:dp:`fls_9m37hN9zgEQf`
A :dt:`program entry point` is a :t:`function` that is invoked at the start of
a Rust program.

.. _fls_v2rjlovqsdyr:

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

:dp:`fls_r36uf3y2denr`
See ``RangePattern.``
See ``RangePattern``.

.. _fls_3ls9xlgt8ei1:

Expand Down
12 changes: 12 additions & 0 deletions src/ownership-and-deconstruction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,18 @@ An :dt:`extending expression` is either
:t:`array expression`, a :t:`borrow expression`, a :t:`struct expression`, a
:t:`tuple expression`, or a :t:`type cast expression`, or

* :dp:`fls_Rj9zhVutfQod`
The :t:`block expression` and :t:`else expression` of an :t:`if expression`
that is an :t:`extending expression`.

* :dp:`fls_oodpp3LpXC13`
The :t:`expression` of an :t:`else expression` that is an :t:`extending
expression`.

* :dp:`fls_xGThCPoTUSAi`
The :t:`expression` of a :t:`match arm` of a :t:`match expression` that is an
:t:`extending expression`.

* :dp:`fls_iqw0d1l1lj3i`
The :t:`tail expression` of a :t:`block expression` that is an
:t:`extending expression`.
Expand Down
Loading

0 comments on commit b4ab93e

Please sign in to comment.