Skip to content

Commit 0e784c5

Browse files
committed
Specify #127672 changes
1 parent 41de15c commit 0e784c5

File tree

3 files changed

+42
-3
lines changed

3 files changed

+42
-3
lines changed

src/changelog.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ Language changes in Rust 1.82.0
4646

4747
* `Stabilize opaque type precise capturing (RFC 3617) <https://github.com/rust-lang/rust/pull/127672>`_
4848

49+
* Changed syntax: :s:`ImplTraitTypeSpecification`, :s:`ImplTraitTypeSpecificationOneBound`
50+
51+
* New syntax: :s:`UseCaptures`, :s:`UseCapturesGenericArgs`, , :s:`UseCapturesGenericArg`
52+
53+
* New paragraphs: :p:`fls_69hqMjvNno9u`, :p:`fls_OnyR0Wsfk7KI`, :p:`fls_KgH6c5cC4S0G`, :p:`fls_iT9WCNfUZQnC`
54+
4955
* `Stabilize \`&raw const\` and \`&raw mut\` operators (RFC 2582) <https://github.com/rust-lang/rust/pull/127679>`_
5056

5157
* New section: :ref:`fls_vXGuvRWOLbEE`

src/glossary.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7555,6 +7555,17 @@ unsuffixed integer
75557555
An :dt:`unsuffixed integer` is an :t:`integer literal` without an
75567556
:t:`integer suffix`.
75577557

7558+
.. _fls_Z8qvOkP4Zfj5:
7559+
7560+
use capture
7561+
^^^^^^^^^^^
7562+
7563+
:dp:`fls_eZyPXG27Zwcg`
7564+
An :dt:`use capture` is a :t:`generic parameter` referenced via keyword $$use$$ within an :t:`anonymous return type`.
7565+
7566+
:dp:`fls_Z8qvOkP4Zfj5`
7567+
See :s:`UseCaptures`.
7568+
75587569
.. _fls_fow1bnvduafi:
75597570

75607571
use import

src/types-and-traits.rst

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,10 +1113,20 @@ Impl Trait Types
11131113
.. syntax::
11141114

11151115
ImplTraitTypeSpecification ::=
1116-
$$impl$$ TypeBoundList
1116+
$$impl$$ UseCaptures? TypeBoundList
11171117

11181118
ImplTraitTypeSpecificationOneBound ::=
1119-
$$impl$$ TraitBound
1119+
$$impl$$ UseCaptures? TraitBound
1120+
1121+
UseCaptures ::=
1122+
$$<$$ UseCapturesGenericArgs? $$>$$
1123+
1124+
UseCapturesGenericArgs ::=
1125+
UseCapturesGenericArg ($$,$$ UseCapturesGenericArg)* $$,$$?
1126+
1127+
UseCapturesGenericArg ::=
1128+
Lifetime
1129+
| Identifier
11201130
11211131
.. rubric:: Legality Rules
11221132

@@ -1146,6 +1156,18 @@ of the :t:`return type`'s :t:`function` and its parent :t:`trait` or
11461156
:dp:`fls_ECjhEI7eCwAj`
11471157
An :t:`impl trait type` shall not contain :t:`[opt-out trait bound]s`.
11481158

1159+
:dp:`fls_69hqMjvNno9u`
1160+
An :t:`use capture` is a :t:`generic parameter` referenced via keyword ``use`` within an :t:`anonymous return type`.
1161+
1162+
:dp:`fls_OnyR0Wsfk7KI`
1163+
:t:`[use capture]s` shall only be used within :t:`[anonymous return type]s`.
1164+
1165+
:dp:`fls_KgH6c5cC4S0G`
1166+
An :t:`anonymous return type` that does not specify a list of :t:`[use capture]s` implicitly :t:`[use capture]s` all :t:`[type parameter]s` and :t:`[constant parameter]s` that are in :t:`scope`.
1167+
1168+
:dp:`fls_iT9WCNfUZQnC`
1169+
An :t:`anonymous return type` behaves as if it contained all its :t:`[use capture]s`.
1170+
11491171
.. rubric:: Examples
11501172

11511173
.. code-block:: rust
@@ -2309,7 +2331,7 @@ any resulting :t:`type` information via :t:`type unification`.
23092331
:dp:`fls_v5dWGuBKvQSJ`
23102332
When an :t:`associated type` ``<Type as Trait>::Assoc`` is referenced within a
23112333
:t:`type inference root` (either explicitly within the source code, or via the
2312-
inferece rules below), an :t:`obligation` requiring that ``Type`` implements
2334+
inference rules below), an :t:`obligation` requiring that ``Type`` implements
23132335
``Trait`` is introduced.
23142336

23152337
:dp:`fls_SZgixDCAx6PQ`

0 commit comments

Comments
 (0)