-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Variables bound with different modes in patterns #23610
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.
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.
Type
Fields
Give feedbackNo fields configured for issues without a type.
The following doesn't compile:
failing with the following error:
However, the following does work:
Is there any reason rust can't just perform this reborrow automatically?
&refis a very cryptic pattern.