You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The style of the reference is to document the latest edition in the main
body of the text, and any differences in a separate block. As a
compromise, I included links to the edition description.
Copy file name to clipboardExpand all lines: src/destructors.md
+5-2
Original file line number
Diff line number
Diff line change
@@ -211,8 +211,8 @@ smallest scope that contains the expression and is one of the following:
211
211
guard.
212
212
* The body expression for a match arm.
213
213
* Each operand of a [lazy boolean expression].
214
-
**Starting from Edition 2024* the pattern-matching condition and consequent body of [`if let`].
215
-
**Starting from Edition 2024* the entirety of the tail expression of a block.
214
+
*The pattern-matching condition and consequent body of [`if let`] ([destructors.scope.temporary.edition2024]).
215
+
*The entirety of the tail expression of a block ([destructors.scope.temporary.edition2024]).
216
216
217
217
> **Notes**:
218
218
>
@@ -221,6 +221,9 @@ smallest scope that contains the expression and is one of the following:
221
221
> example, the temporary for `1` in `match 1 { ref mut z => z };` lives until
222
222
> the end of the statement.
223
223
224
+
r[destructors.scope.temporary.edition2024]
225
+
> **Edition differences**: The 2024 edition added two new temporary scope narrowing rules: `if let` temporaries are dropped before the `else` block, and temporaries of tail expressions of blocks are dropped immediately after the tail expression is evaluated.
0 commit comments