From 07617826f9673d7e5f891980c8500ff97403afb0 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Mon, 8 Jul 2024 10:12:48 +0200 Subject: [PATCH 1/2] Describe RPIT parameter capturing --- src/changelog.rst | 2 +- src/types-and-traits.rst | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/changelog.rst b/src/changelog.rst index dcc84327..e3b3cc35 100644 --- a/src/changelog.rst +++ b/src/changelog.rst @@ -82,7 +82,7 @@ Language changes in Rust 1.79.0 * `Rework \`impl Trait\` lifetime inference `_ - * No change: capturing of lifestime within ``impl Trait`` types is not described in the FLS + * No paragraphs: :p:`fls_Xo1ODwOyX7Vm`, :p:`fls_kTGFLFymTWch` * `Change inductive trait solver cycles to be ambiguous `_ diff --git a/src/types-and-traits.rst b/src/types-and-traits.rst index 93fa081e..c9a91d6e 100644 --- a/src/types-and-traits.rst +++ b/src/types-and-traits.rst @@ -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`. From 45921f414b860243512cc4054b14a0b0e8440fe5 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Mon, 8 Jul 2024 10:40:51 +0200 Subject: [PATCH 2/2] Update src/changelog.rst Co-authored-by: Pietro Albini --- src/changelog.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/changelog.rst b/src/changelog.rst index e3b3cc35..fcd442e0 100644 --- a/src/changelog.rst +++ b/src/changelog.rst @@ -82,7 +82,7 @@ Language changes in Rust 1.79.0 * `Rework \`impl Trait\` lifetime inference `_ - * No paragraphs: :p:`fls_Xo1ODwOyX7Vm`, :p:`fls_kTGFLFymTWch` + * New paragraphs: :p:`fls_3aKZB0ILIkZw`, :p:`fls_Xo1ODwOyX7Vm`, :p:`fls_kTGFLFymTWch` * `Change inductive trait solver cycles to be ambiguous `_