Skip to content
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

Preliminary work for #17940 #17941

Merged
merged 9 commits into from
Aug 26, 2024
Merged

Conversation

ChayimFriedman2
Copy link
Contributor

I split the PR as requested, and made small commits.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 22, 2024
crates/hir-ty/src/infer/closure.rs Outdated Show resolved Hide resolved
crates/hir-ty/src/infer/closure.rs Show resolved Hide resolved
crates/hir-ty/src/infer/closure.rs Show resolved Hide resolved
crates/syntax/rust.ungram Outdated Show resolved Hide resolved
full_range: 7800..8008,
full_range: 7800..8042,
Copy link
Member

@Veykril Veykril Aug 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We really need to do something about these tests its so annoying that touching minicore keeps changing this (not for you to do specifically, just a remark)

Also create a test infrastructure for capture computation.
This is important for the "convert closure to fn" assist, as it needs to find and modify the places the captures are used.
We don't yet lower or maybe even parse them, but blocks already have `gen`, so why not.
Previously we were ignoring them.
This will be needed as we parse unknown identifiers and want to insert them into source code.
We can impl PartialOrd and Ord too, but I didn't need that.
@ChayimFriedman2
Copy link
Contributor Author

Addressed comments and added explanation about span stacks.

@Veykril
Copy link
Member

Veykril commented Aug 25, 2024

Cool, thanks for the extra comments. Will merge this after tomorrows release

@Veykril
Copy link
Member

Veykril commented Aug 26, 2024

@bors r+

@bors
Copy link
Contributor

bors commented Aug 26, 2024

📌 Commit 52462ad has been approved by Veykril

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Aug 26, 2024

⌛ Testing commit 52462ad with merge 0ad26e6...

@bors
Copy link
Contributor

bors commented Aug 26, 2024

☀️ Test successful - checks-actions
Approved by: Veykril
Pushing 0ad26e6 to master...

@bors bors merged commit 0ad26e6 into rust-lang:master Aug 26, 2024
11 checks passed
bors added a commit that referenced this pull request Aug 29, 2024
feat: Create an assist to convert closure to freestanding fn

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants