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

Add diagram back to RFC 3606. #3636

Merged
merged 2 commits into from
May 14, 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
6 changes: 6 additions & 0 deletions text/3606-temporary-lifetimes-in-tail-expressions.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@

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

![A diagram showing a function with one let statement "let x = g();" and a tail expression "temp().h()"
and a visualisation of how long x and temp live before and after this change.
Before: x is created first, then temp is created, then x is dropped, then temp is dropped.
After: x is created first, then temp is created, then temp is dropped, then x is dropped.
](3606-temporary-lifetimes-in-tail-expressions/diagram.svg)

# Motivation

Temporaries in the tail expression in a block live longer than the block itself,
Expand Down
4 changes: 4 additions & 0 deletions text/3606-temporary-lifetimes-in-tail-expressions/diagram.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.