Skip to content

Add GenericArgs::as_closure and DefId::is_closure_like to rustc_public - #166570

Open
adpthegreat wants to merge 5 commits into
rust-lang:mainfrom
adpthegreat:add_generics_arg_closure
Open

adpthegreat wants to merge 5 commits into
rust-lang:mainfrom
adpthegreat:add_generics_arg_closure

Conversation

@adpthegreat

Copy link
Copy Markdown
Contributor

Closes rust-lang/rustc_public#121

No LLMs were used in the generation of this PR

This PR adds multiple things

  • Two new methods to the CompilerCtxt - as_closure exposed from here and the corresponding Stable Trait implementation for ClosureArgs to convert it from the mir type to the rustc_public type

  • Added ClosureArgsParts rustc_public type and its associated helper methods

  • Added is_closure_like that takes in a Defid and checks whether the type is a closure, exposed it through the rustc_public_bridge from here to the DefId struct impl

@rustbot

rustbot commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator

This PR changes rustc_public

cc @oli-obk, @celinval, @ouz-a, @makai410

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 25, 2026
@rustbot

rustbot commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator

r? @folkertdev

rustbot has assigned @folkertdev.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 79 candidates
  • Random selection from 22 candidates

@rustbot

rustbot commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@rustbot

This comment has been minimized.

@rustbot rustbot added has-merge-commits PR has merge commits, merge with caution. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 25, 2026
@rust-log-analyzer

This comment has been minimized.

@adpthegreat adpthegreat changed the title Add generics arg closure Add GenericArgs::as_closure and DefId::is_closure_like to rustc_public Nov 25, 2026
@adpthegreat
adpthegreat force-pushed the add_generics_arg_closure branch from 8d588f9 to 9f18029 Compare November 25, 2026 20:43
@rustbot rustbot removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. has-merge-commits PR has merge commits, merge with caution. labels Nov 25, 2026
@adpthegreat

Copy link
Copy Markdown
Contributor Author

@rustbot label -has-merge-commits

@adpthegreat

Copy link
Copy Markdown
Contributor Author

@makai410 please review

@makai410

Copy link
Copy Markdown
Member

r? me

@rustbot rustbot assigned makai410 and unassigned folkertdev Nov 27, 2026

This branch has not been deployed

No deployments
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. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add GenericArgs::as_closure

5 participants