From e6f6b0dc2868ea07d078d504132c237b4f4c57fe Mon Sep 17 00:00:00 2001 From: Kevin Reid Date: Thu, 3 Apr 2025 08:39:47 -0700 Subject: [PATCH] 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. --- src/destructors.md | 1 + 1 file changed, 1 insertion(+) diff --git a/src/destructors.md b/src/destructors.md index 2f4711815..41490a869 100644 --- a/src/destructors.md +++ b/src/destructors.md @@ -208,6 +208,7 @@ smallest scope that contains the expression and is one of the following: * The body expression for a match arm. * Each operand of a [lazy boolean expression]. * The pattern-matching condition and consequent body of [`if let`] ([destructors.scope.temporary.edition2024]). +* The pattern-matching condition and loop body of [`while let`]. * The entirety of the tail expression of a block ([destructors.scope.temporary.edition2024]). > [!NOTE]