Add Lifetime Capture Rules 2024
The rules for which generic lifetime parameters are automatically
captured in an RPIT-like opaque type are changing in Rust 2024
according to RFC 3498. Let's document these changes.
diff --git a/src/types/impl-trait.md b/src/types/impl-trait.md
index 5a91334..43a62e4 100644
--- a/src/types/impl-trait.md
+++ b/src/types/impl-trait.md
@@ -119,13 +119,10 @@
r[type.impl-trait.generic-capture.auto]
r[type.impl-trait.generic-capture.auto.intro]
-Return-position `impl Trait` abstract types automatically capture certain of the in-scope generic parameters. Everywhere, these automatically capture all in-scope type and const generic parameters.
+Return-position `impl Trait` abstract types automatically capture all in-scope generic parameters, including generic type, const, and lifetime parameters (including higher-ranked ones).
-r[type.impl-trait.generic-capture.auto.trait]
-On items of trait impls and trait definitions, these types additionally automatically capture all in-scope generic lifetime parameters, including higher-ranked ones\1
-
-r[type.impl-trait.generic-capture.auto.fn]
-On free functions and on associated functions and methods of inherent impls, only the generic lifetime parameters that appear in the bounds of abstract return type are captured.
+r[type.impl-trait.generic-capture.edition2024]
+> **Edition differences**: Before the 2024 edition, on free functions and on associated functions and methods of inherent impls, generic lifetime parameters that do not appear in the bounds of the abstract return type are not automatically captured.
## Precise capturing