Skip to content

Refine scopes around temporaries generated in local accesses#92508

Closed
dingxiangfei2009 wants to merge 7 commits intorust-lang:masterfrom
dingxiangfei2009:fix-64130-refine-scopes
Closed

Refine scopes around temporaries generated in local accesses#92508
dingxiangfei2009 wants to merge 7 commits intorust-lang:masterfrom
dingxiangfei2009:fix-64130-refine-scopes

Conversation

@dingxiangfei2009
Copy link
Copy Markdown
Contributor

@dingxiangfei2009 dingxiangfei2009 commented Jan 3, 2022

Fix #57017
Fix #72956

Related to #69663

Sorry for the long sabbatical. This PR takes inspiration from the comments by @pnkfelix and further extends the idea to at least allow refined scopes for temporaries generated while evaluating expressions like x.status(). In details, expressions like x.status() generates temporaries for place or place references to a local variable x, but they could be discarded at an earlier opportunity. What is left to improve the region analysis in a generator body is to identify regions where we can restrict those temporaries. They are tentatively set to if and match sub-expressions.

I have come to a rather late realization that #91032 could be solving the related problems in a more comprehensive setting. However, I would like to gather some feedback and join the relevant discussion with this opportunity.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-inactive Status: Inactive and waiting on the author. This is often applied to closed PRs. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

10 participants