Skip to content

Commit 9d09478

Browse files
authored
Merge pull request #568 from ferrocene/precise-capture-fixes
Precise capture fixes
2 parents 6052c18 + 32d2fec commit 9d09478

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/types-and-traits.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,7 +1119,7 @@ Impl Trait Types
11191119
$$impl$$ UseCaptures? TraitBound
11201120

11211121
UseCaptures ::=
1122-
$$<$$ UseCapturesGenericArgs? $$>$$
1122+
$$use$$ $$<$$ UseCapturesGenericArgs? $$>$$
11231123

11241124
UseCapturesGenericArgs ::=
11251125
UseCapturesGenericArg ($$,$$ UseCapturesGenericArg)* $$,$$?
@@ -1157,10 +1157,7 @@ of the :t:`return type`'s :t:`function` and its parent :t:`trait` or
11571157
An :t:`impl trait type` shall not contain :t:`[opt-out trait bound]s`.
11581158

11591159
: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`.
1160+
An :t:`use capture` is a :t:`generic parameter` referenced within an :t:`anonymous return type`.
11641161

11651162
:dp:`fls_KgH6c5cC4S0G`
11661163
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`.
@@ -2896,6 +2893,7 @@ Trait and Lifetime Bounds
28962893
LifetimeIndication
28972894
| ParenthesizedTraitBound
28982895
| TraitBound
2896+
| UseCaptures
28992897
29002898
LifetimeIndication ::=
29012899
Lifetime
@@ -2977,6 +2975,9 @@ If an :t:`outlives bound` applies to the :t:`type` of a :t:`function parameter`
29772975
or to a :t:`return type`, then this bound also applies to the related
29782976
:t:`function` as an :t:`implied bound`.
29792977

2978+
:dp:`fls_OnyR0Wsfk7KI`
2979+
:t:`[Use capture]` :t:`[bound]s` shall only be used within :t:`[anonymous return type]s`.
2980+
29802981
.. rubric:: Examples
29812982

29822983
.. code-block:: rust

0 commit comments

Comments
 (0)