Incorrect explanation for upvar move in FnMut closure #100896
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Given the following code (playground):
The current output is:
The error is correct, but the diagnostic points to
upvar.take()
as the reason why the value is moved, while the real culprit is the match expressionif let Some(_s) = upvar {}
, which is not indicated.Occurs in 1.63.0 stable and
1.65.0-nightly (2022-08-16 86c6ebee8fa0a5ad1e18)
.The text was updated successfully, but these errors were encountered: