-
-
Notifications
You must be signed in to change notification settings - Fork 15k
Returning the result of reborrowing in pattern matching causes compilation error #92038
Copy link
Copy link
Open
Labels
A-borrow-checkerArea: The borrow checkerArea: The borrow checkerA-patternsRelating to patterns and pattern matchingRelating to patterns and pattern matchingC-bugCategory: This is a bug.Category: This is a bug.D-confusingDiagnostics: Confusing error or lint that should be reworked.Diagnostics: Confusing error or lint that should be reworked.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.T-langRelevant to the language teamRelevant to the language teamfixed-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 checkerA-patternsRelating to patterns and pattern matchingRelating to patterns and pattern matchingC-bugCategory: This is a bug.Category: This is a bug.D-confusingDiagnostics: Confusing error or lint that should be reworked.Diagnostics: Confusing error or lint that should be reworked.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.T-langRelevant to the language teamRelevant to the language teamfixed-by-poloniusCompiling with `-Zpolonius` fixes this issue.Compiling with `-Zpolonius` fixes this issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
This fails to compile on latest stable (and nightly) (playground):
This seems like a bug in
rustc, especially considering that any of the following are compiling just fine (playground):Originally I've found this bug with code like this (playground):
Meta
rustc
1.57.01.59.0-nightly (2021-12-13 8f117a77d0880ed59afc)