Skip to content

Commit e6f6b0d

Browse files
authored
Mention the temporary scope of while let.
I'm not an expert here, but because `while let` is a loop, it *has to* drop temporaries when it loops, so it must have at least one temporary scope, and empirically, the same scope includes the scrutinee and the body because the body can use temporaries from the scrutinee.
1 parent bbe4b18 commit e6f6b0d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/destructors.md

+1
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ smallest scope that contains the expression and is one of the following:
208208
* The body expression for a match arm.
209209
* Each operand of a [lazy boolean expression].
210210
* The pattern-matching condition and consequent body of [`if let`] ([destructors.scope.temporary.edition2024]).
211+
* The pattern-matching condition and loop body of [`while let`].
211212
* The entirety of the tail expression of a block ([destructors.scope.temporary.edition2024]).
212213

213214
> [!NOTE]

0 commit comments

Comments
 (0)