-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
found a bug in the borrow checker #70044
Copy link
Copy link
Open
Labels
A-borrow-checkerArea: The borrow checkerArea: The borrow checkerC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.fixed-by-poloniusCompiling with `-Zpolonius` fixes this issue.Compiling with `-Zpolonius` fixes this issue.
Metadata
Metadata
Assignees
Labels
A-borrow-checkerArea: The borrow checkerArea: The borrow checkerC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.fixed-by-poloniusCompiling with `-Zpolonius` fixes this issue.Compiling with `-Zpolonius` fixes this issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
I tried this code:
I expected to see this happen: print 1 then 0.
Instead, this happened: compile error
Meta
rustc --version --verbose:Backtrace
EDIT: Here's a concise version of the original snippet which produces the same error:
it is weird since the buggy behavior depends on the access order between the variables v1 and v2, if change the order or access only one of the two variables, the compiler error disappears