Skip to content

Commit 929c584

Browse files
committed
Prepare RFC 3606 to be merged
The FCP has completed on RFC 3606, so let's prepare it to be merged. First, we'll shorten the name of the feature flag a bit; this should still be unambiguous. Second, we're going to remove the graphic from the summary. While it may be illustrative, the text and the other examples seem clear enough without it, and its benefits have to be weighed against the fact that we want the content in this repository to be easily editable and freestanding. Pulling in an SVG file from an outside host pulls against that. If we come to think the graphic is critical, we could always add it back in a separate PR that would add an editable version of this SVG file into the repository itself. Third, let's make the H1 title of the document a bit more clear.
1 parent 9053ae4 commit 929c584

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

text/3606-temporary-lifetimes-in-tail-expressions.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
1-
# Temporary lifetimes in tail expressions
1+
# Shorter temporary lifetimes in tail expressions
22

3-
- Feature Name: `tail_temporaries_shorter_lifetime`
3+
- Feature Name: `shorter_tail_lifetimes`
44
- Start Date: 2023-05-04
55
- RFC PR: [rust-lang/rfcs#3606](https://github.com/rust-lang/rfcs/pull/3606)
6-
- Rust Issue: [rust-lang/rust#123739](https://github.com/rust-lang/rust/issues/123739)
6+
- Tracking Issue: [rust-lang/rust#123739](https://github.com/rust-lang/rust/issues/123739)
77

88
# Summary
99

1010
In the next edition, drop temporaries in tail expressions *before* dropping locals, rather than after.
1111

12-
![A diagram showing a function with one let statement "let x = g();" and a tail expression "temp().h()"
13-
and a visualisation of how long x and temp live before and after this change.
14-
Before: x is created first, then temp is created, then x is dropped, then temp is dropped.
15-
After: x is created first, then temp is created, then temp is dropped, then x is dropped.
16-
](https://hackmd.io/_uploads/HyVB0FtkA.svg)
17-
1812
# Motivation
1913

2014
Temporaries in the tail expression in a block live longer than the block itself,

0 commit comments

Comments
 (0)