-
-
Notifications
You must be signed in to change notification settings - Fork 17.6k
Nested closures give suboptimal move suggestion #64008
Copy link
Copy link
Open
Labels
A-closuresArea: Closures (`|…| { … }`)Area: Closures (`|…| { … }`)A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-lifetimesArea: Lifetimes / regionsArea: Lifetimes / regionsP-lowLow priorityLow priorityT-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.
Description
Activity
Metadata
Metadata
Assignees
Labels
A-closuresArea: Closures (`|…| { … }`)Area: Closures (`|…| { … }`)A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-lifetimesArea: Lifetimes / regionsArea: Lifetimes / regionsP-lowLow priorityLow priorityT-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.
The following code needs a
moveon themapclosure, but the suggestion first tells us to add it to theflat_mapclosure. After following that suggestion, the next error will tell us to put it on themapclosure. This terminates correctly, but should suggest the final thing immediately. Note that with many nested levels of closures, there will be one error-fix-recompile cycle per nested closure until we get it working.(Playground)
Errors: