Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Describe RPIT parameter capturing #514

Merged
merged 2 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Language changes in Rust 1.79.0

* `Rework \`impl Trait\` lifetime inference <https://github.com/rust-lang/rust/pull/116891/>`_

* No change: capturing of lifestime within ``impl Trait`` types is not described in the FLS
* New paragraphs: :p:`fls_3aKZB0ILIkZw`, :p:`fls_Xo1ODwOyX7Vm`, :p:`fls_kTGFLFymTWch`

* `Change inductive trait solver cycles to be ambiguous <https://github.com/rust-lang/rust/pull/122791>`_

Expand Down
15 changes: 15 additions & 0 deletions src/types-and-traits.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1123,6 +1123,21 @@ An :t:`impl trait type` is a :t:`type` that implements a :t:`trait`, where the
An :t:`impl trait type` shall appear only within a :t:`function parameter` or
the :t:`return type` of a :t:`function`.

:dp:`fls_3aKZB0ILIkZw`
An :t:`anonymous return type` is an :t:`impl trait type` ascribed to a
:t:`function` :t:`return type`.

:dp:`fls_Xo1ODwOyX7Vm`
An :t:`anonymous return type` behaves as if it contained all declared :t:`[type
parameter]s` of the :t:`return type`'s :t:`function` and its parent :t:`trait`
or :t:`implementation`.

:dp:`fls_kTGFLFymTWch`
An :t:`anonymous return type` derived from an :t:`async function` behaves as if
it contained all declared :t:`[type parameter]s` and :t:`[lifetime parameter]s`
of the :t:`return type`'s :t:`function` and its parent :t:`trait` or
:t:`implementation`.

:dp:`fls_ECjhEI7eCwAj`
An :t:`impl trait type` shall not contain :t:`[opt-out trait bound]s`.

Expand Down
Loading