Skip to content

Reimplement const closures#153818

Open
oli-obk wants to merge 8 commits intorust-lang:mainfrom
oli-obk:const-closures
Open

Reimplement const closures#153818
oli-obk wants to merge 8 commits intorust-lang:mainfrom
oli-obk:const-closures

Conversation

@oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Mar 13, 2026

Tracking issue: #106003

Best reviewed commit-by-commit

The old solver can't handle for<'a> |x: &'a()| () closures in const contexts, but that feature is unstable itself, so we can just leave it to the next solver to handle.

We need a lot more tests, we're testing the bare minimum of success and failure paths right now.

r? @fee1-dead

@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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Mar 13, 2026
@fmease fmease added the PG-const-traits Project group: Const traits label Mar 13, 2026
Copy link
Member

@fee1-dead fee1-dead left a comment

Choose a reason for hiding this comment

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

small nit, overall looks good so r=me

View changes since this review

Copy link
Member

Choose a reason for hiding this comment

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

Why did this get deleted?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It has duplicates that are no different from it anymore (rejected in the early check about const closures in normal code) and the difference in covered code paths doesn't exist anymore.

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 13, 2026
@rustbot
Copy link
Collaborator

rustbot commented Mar 13, 2026

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@oli-obk
Copy link
Contributor Author

oli-obk commented Mar 13, 2026

@bors r=fee1-dead

@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 13, 2026

📌 Commit 9503c31 has been approved by fee1-dead

It is now in the queue for this repository.

@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PG-const-traits Project group: Const traits S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants