Skip to content

Commit 4ad2685

Browse files
authored
Merge pull request #1681 from ehuss/lazy-temp-drop-order
Fix rule for lazy boolean temporary drop scope
2 parents e0a0414 + 4fc067e commit 4ad2685

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/destructors.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ smallest scope that contains the expression and is one of the following:
210210
* The condition expression of an `if` or `while` expression, or a `match`
211211
guard.
212212
* The body expression for a match arm.
213-
* The second operand of a [lazy boolean expression].
213+
* Each operand of a [lazy boolean expression].
214214

215215
> **Notes**:
216216
>
@@ -242,11 +242,11 @@ if PrintOnDrop("If condition").0 == "If condition" {
242242
unreachable!()
243243
};
244244

245-
// Dropped at the end of the statement
245+
// Dropped before the first ||
246246
(PrintOnDrop("first operand").0 == ""
247-
// Dropped at the )
247+
// Dropped before the )
248248
|| PrintOnDrop("second operand").0 == "")
249-
// Dropped at the end of the expression
249+
// Dropped before the ;
250250
|| PrintOnDrop("third operand").0 == "";
251251

252252
// Dropped at the end of the function, after local variables.

0 commit comments

Comments
 (0)