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

Fix rule for lazy boolean temporary drop scope #1681

Merged
merged 1 commit into from
Nov 23, 2024
Merged
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
8 changes: 4 additions & 4 deletions src/destructors.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ smallest scope that contains the expression and is one of the following:
* The condition expression of an `if` or `while` expression, or a `match`
guard.
* The body expression for a match arm.
* The second operand of a [lazy boolean expression].
* Each operand of a [lazy boolean expression].

> **Notes**:
>
Expand Down Expand Up @@ -242,11 +242,11 @@ if PrintOnDrop("If condition").0 == "If condition" {
unreachable!()
};

// Dropped at the end of the statement
// Dropped before the first ||
(PrintOnDrop("first operand").0 == ""
// Dropped at the )
// Dropped before the )
|| PrintOnDrop("second operand").0 == "")
// Dropped at the end of the expression
// Dropped before the ;
|| PrintOnDrop("third operand").0 == "";

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