-
Notifications
You must be signed in to change notification settings - Fork 1.9k
feat: Create an assist to convert closure to freestanding fn #17940
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Can you split the PR in two if possible? One for the assist and one for all the other stuff? 2k line diff isn't that nice to review, and I also generally dread reviewing assist PRs so that doesn't help 😅 Though I guess reviewing commit by commit is also an option, though I likely won't review all of it in one sitting. |
3e0eb86 to
74eeb75
Compare
0f05961 to
7ff7c2b
Compare
Preliminary work for #17940 I split the PR as requested, and made small commits.
7ff7c2b to
c5e1911
Compare
| capture.kind(), | ||
| capture_usage.is_ref(), | ||
| ) | ||
| .clone_for_update(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is more a question for @Veykril, but: is there an alternative to the clone_for_update call that could be used here or do we need to wait to wait for #15710 (comment) to happen first?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a couple, but they are all likewise kind of annoying to do ... I imagine until we get the node tracking stuff making this not use mutable nodes is gonna be ugly
| capture.kind(), | ||
| capture_usage.is_ref(), | ||
| ) | ||
| .clone_for_update(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a couple, but they are all likewise kind of annoying to do ... I imagine until we get the node tracking stuff making this not use mutable nodes is gonna be ugly
c5e1911 to
e67f6e3
Compare
|
@Veykril, addressed comments. |
The assist converts all captures to parameters.
e67f6e3 to
0e4f4d3
Compare
|
Thanks! Gonna be a very useful assist @bors r+ |
|
☀️ Test successful - checks-actions |
The assist converts all captures to parameters.
Closes #17920.
This was more work than I though, since it has to handle a bunch of edge cases...
Based on #17941. Needs to merge it first.